Author |
Topic |
Pace
Constraint Violating Yak Guru
264 Posts |
Posted - 2006-09-29 : 04:38:46
|
Hi all, I thought that you couldnt do an update with a Join?UPDATE OD SET Discount = Discount + 0.05FROM OrderDetails AS OD JOIN Products AS P ON OD.ProductID = P.ProductIDWHERE SupplierID = 1 "Impossible is Nothing"  |
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2006-09-29 : 04:43:13
|
Well you know what thought did - don't you? Duane. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-29 : 04:46:38
|
Is there a question involved?Peter LarssonHelsingborg, Sweden |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-09-29 : 04:56:40
|
Thought is a mental process which allows beings to model the world, and so to deal with it effectively according to their goals, plans, ends and desires.Try is to make an effort to do or accomplish.Try and you will loose nothing but only gain. KH |
 |
|
Pace
Constraint Violating Yak Guru
264 Posts |
Posted - 2006-09-29 : 05:23:10
|
hehe thanks for that! every day I learn and love sql more and more!"Impossible is Nothing" |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-09-29 : 07:37:08
|
"Hi all, I thought that you couldnt do an update with a Join?"Well you can't update both tables in one statement And I guess it won't surprise you, now, that you can also do:DELETE ODFROM OrderDetails AS OD JOIN Products AS P ON OD.ProductID = P.ProductIDWHERE SupplierID = 1 Kristen |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-09-29 : 08:29:59
|
>>I thought that you couldnt do an update with a Join?Why?What forced you to think so?MadhivananFailing to plan is Planning to fail |
 |
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2006-09-29 : 19:43:24
|
FWIW, I don't believe that this is official SQL syntax; just a variation specific to MS.=======================================If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy. -James Madison, fourth US president (1751-1836) |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-09-30 : 02:00:21
|
quote: Originally posted by Bustaz Kool FWIW, I don't believe that this is official SQL syntax; just a variation specific to MS.=======================================If Tyranny and Oppression come to this land, it will be in the guise of fighting a foreign enemy. -James Madison, fourth US president (1751-1836)
Yes I think soMadhivananFailing to plan is Planning to fail |
 |
|
|