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 |
|
lucsky8
Posting Yak Master
105 Posts |
Posted - 2009-05-05 : 09:20:31
|
| Hi,it probably easy but i have no ideaI have simple queryselect * from tblElevesinner join tblResultat on tblEleves.intEleveId = tblResultat.intEleveIdwhere tblEleves.intEcoleId = 1227All the result are ok but i need to delete evrething that not equal to this query.I hope i explain my self wright |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-05-05 : 09:24:40
|
delete from which table ? tblEleves or tblResultat ? or both ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
lucsky8
Posting Yak Master
105 Posts |
Posted - 2009-05-05 : 12:08:07
|
Sorry i had a meeting delete fromtblEleves Delete from tblEleves if intEleveId is not in tblResultatCan i use :DELETEFROM tblElevesWHERE tblEleves.intEleveId NOT IN (select intEleveId from tblResultat) andtblEleves.intEcoleId = 1227quote: Originally posted by khtan delete from which table ? tblEleves or tblResultat ? or both ? KH[spoiler]Time is always against us[/spoiler]
|
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-05-05 : 13:04:51
|
| don't you want tblEleves.intEcoleId <> 1227 instead ? |
 |
|
|
lucsky8
Posting Yak Master
105 Posts |
Posted - 2009-05-05 : 15:17:15
|
It ok it work with DELETEFROM tblElevesWHERE tblEleves.intEleveId NOT IN (select intEleveId from tblResultat) andtblEleves.intEcoleId = 1227Tks for your helpquote: Originally posted by sakets_2000 don't you want tblEleves.intEcoleId <> 1227 instead ?
|
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-05-05 : 15:35:33
|
| It will work. But going from what you said previously, "but i need to delete evrething that not equal to this query"... just give a thought once more to what you want. Hope it makes sense. |
 |
|
|
|
|
|