|
Posted by Jeff Kish on 10/01/35 11:29
On 6 Oct 2005 01:00:14 -0700, "David Portas"
<REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote:
>What is the key of this table? Please post proper DDL so that we don't
>have to guess. I'm going to assume that the combination of all three
>columns is unique, in which case try this:
>
>DELETE FROM tbl
> WHERE EXISTS
> (SELECT *
> FROM tbl AS T
> WHERE T.table_name_start = tbl.table_name_end
> AND T.table_name_end = tbl.table_name_start
> AND T.column_name = T.column_name)
> AND table_name_start > table_name_end ;
>
>--
>David Portas
>SQL Server MVP
David,
Very sorry but I did not realize that would make a difference. (really
I didn't).
There actually was not a primary key (this was a temporary working
table).
I've put a primary key into place now, but I used the script before
that.
It seemed to work fine I've never used the 'AS' before.. I guess I
better study up a bit on it.
Oh.. the ddl was this:
CREATE TABLE [allEdges] (
[table_name_start] [varchar] (255) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[column_name] [varchar] (255) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[table_name_end] [varchar] (255) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
Navigation:
[Reply to this message]
|