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 |
|
Poddy88
Starting Member
26 Posts |
Posted - 2009-02-21 : 12:51:34
|
| Anybody got any idea how to i use this not statement within the joins, iv tried placing it in serval areas with nothing accomplishedwhere not server_tocab.Server_ID = 0SELECT cabinet.cabinet_id, router_tocab.router_idFrom cabinetINNER JOIN server_tocabon cabinet.server_id=server_tocab.Server_ID INNER JOIN router_tocabON cabinet.router_id=router_tocab.router_idorder by cabinet.cabinet_id |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-21 : 12:54:02
|
Did you mean this?SELECT cabinet.cabinet_id, router_tocab.router_idFrom cabinetINNER JOIN server_tocabon cabinet.server_id=server_tocab.Server_ID INNER JOIN router_tocabON cabinet.router_id=router_tocab.router_idWhere server_tocab.Server_ID <> 0Order by cabinet.cabinet_id |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-21 : 12:54:54
|
| Why duplicate?http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=120295 |
 |
|
|
Poddy88
Starting Member
26 Posts |
Posted - 2009-02-21 : 13:02:32
|
| Yeh something like that but that line you have used'Where server_tocab.Server_ID <> 0'only selects all of the values which = 0 i want the opposite to select all the values not 0 |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-21 : 14:36:16
|
quote: Originally posted by Poddy88 Yeh something like that but that line you have used'Where server_tocab.Server_ID <> 0'only selects all of the values which = 0 i want the opposite to select all the values not 0
what happen when you run that? |
 |
|
|
Poddy88
Starting Member
26 Posts |
Posted - 2009-02-21 : 17:01:18
|
| its ok iv sorted it thanks for your help, just chucked a not infront of where |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-22 : 00:56:20
|
quote: Originally posted by Poddy88 its ok iv sorted it thanks for your help, just chucked a not infront of where
do you mean not (server_tocab.Server_ID <> 0)but wont that still give you ones with 0? |
 |
|
|
|
|
|