| Author |
Topic |
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-05-25 : 03:59:52
|
hi all, how do i perform this query?DELETE FROM tblStkAdjDetailWHERE (SELECT ItemStorageID FROM tblStkAdjDetail WHERE Status='NEW' AND ItemStorageID NOT IN (SELECT ItemStorageId FROM tblTempTableForRecvPacking) ) ~~~Focus on problem, not solution ¯\(º_o)/¯ ~~~ |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-25 : 04:09:32
|
| [code]Delete t1from tblStkAdjDetail t1 LEFT JOIN tblTempTableForRecvPacking t2on t1.ItemStorageID = t2.ItemStorageIDWhere t1.Status='NEW' and t2.ItemStorageID is NULL[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-05-25 : 04:11:02
|
oppssi forgot to assign the where clause :P, this worked :-DELETE FROM tblstkadjdetail WHERE ItemStorageID= ( SELECT ItemStorageID FROM tblstkadjdetail WHERE status='NEW' AND jobid=@JobID AND ItemStorageID NOT IN (SELECT ItemStorageID FROM tblTemptableForrecvpacking WHERE jobid='AJ25507002')) ps : tan, u were very fast.. i was just about to edit my post..btw.. i used to ty that left join.. but there are times that in the left join table, no such @jobid at all, therefore it didt return null for column itemstorageid.. im not sure if this true.. maybe im wrong~~~Focus on problem, not solution ¯\(º_o)/¯ ~~~ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-25 : 04:28:21
|
quote: ps : tan, u were very fast.. i was just about to edit my post..
Yeah, I am so fast that you can't see me  KH |
 |
|
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-05-25 : 04:34:02
|
| why sometimes your country malasysia/singapore??? where are u?~~~Focus on problem, not solution ¯\(º_o)/¯ ~~~ |
 |
|
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-05-25 : 04:34:49
|
| or maybe u cross m'sia - s'pore every week? hahahah~~~Focus on problem, not solution ¯\(º_o)/¯ ~~~ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-25 : 04:36:46
|
not every week. Once about every 2 or 3 weeks. Currently implementing a project in M'sia so have to travel up there often KH |
 |
|
|
maya_zakry
Constraint Violating Yak Guru
379 Posts |
Posted - 2007-05-25 : 04:42:25
|
| oic.. which part? kl? jb? im stuck im penang.. hahahahhahah... not much travel... :)~~~Focus on problem, not solution ¯\(º_o)/¯ ~~~ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-25 : 04:48:18
|
Normally I will be in Subang Jaya. KH |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-26 : 03:26:10
|
quote: Originally posted by khtan not every week. Once about every 2 or 3 weeks. Currently implementing a project in M'sia so have to travel up there often KH
Swapping countries MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-26 : 06:21:39
|
 KH |
 |
|
|
|