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 |
|
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2012-09-10 : 23:38:13
|
| status idnew 123old 123pending 123new 456old 456i would like to take out all account which doesn't have the status='pending'. I have lots of ID to filter.But it seems to be still in my output.select * from tableAwhere status <> 'pending'i get this output:status idnew 123old 123new 456old 456i want my output to be like this:status idnew 456old 456 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-09-10 : 23:50:05
|
[code]select * from tableA awhere NOT EXISTS ( SELECT * FROM tableA x WHERE x.id = a.id AND x.status = 'pending' )[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2012-09-11 : 00:06:02
|
| thanks..is working fine now! |
 |
|
|
|
|
|