Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-03-24 : 10:27:20
|
| hi is there a function that i can do followingCollumn A // Collumn B 2 // null 3 // null 4 // 5 5 // nullWhen Collum B has a equal number in collumn A, the row that has the match in collum A needs te be deleted 2 // null 3 // null 4 // 5Ty |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-03-24 : 10:56:35
|
| I'm not sure I'm understanding this correctly...but maybe thisdelete from <urtable> where ColumnA in (select distinct ColumnB from <urtable>) |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-03-24 : 10:57:50
|
| dang. i had a script that does this, but it keeps giving me a network interruption when i try and post it....[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQL or How to sell Used CarsFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-03-24 : 11:00:39
|
| [code]declare @foo table (A int, B int)insert into @foos e l e c t 2 , n u l l union all select 3,nullunion all select 4,5union all select 5,nullselect * from @foodelete bfrom @foo ainner join @foo bon a.b = b.a[/code][Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQL or How to sell Used CarsFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-03-24 : 11:01:06
|
| had to space out the letters in the insert statement, or it would not post.. weird.[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQL or How to sell Used CarsFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
|
|
|
|
|