| RE: [SQLDownUnder] case statment in UPDATE STATEMENT |
- From: Peter Ward
- Subject: RE: [SQLDownUnder] case statment in UPDATE STATEMENT
- Date: Fri, 11 Mar 2005 13:35:52 +1100
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Anthony
Using the Northwind OrderS table as an example
UPDATE northwind.dbo.orders
SET Freight =
CASE
WHEN ShipVia = 3 THEN Freight * 1.1
WHEN ShipVia = 1 THEN Freight * 1.15
ELSE Freight * 1.3
END
Peter Ward
WARDY IT Solutions Chief Technical Architect
Phone: +61 7 3856 5411 Mobile: +61 0 403 177 761
WARDY IT Solutions - Specialising in building Microsoft SQL Server Solutions
________________________________
From: SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx on behalf of anthony
Sent: Fri 3/11/2005 12:39 PM
To: SQLDownUnder@xxxxxxxxxxxxxxxxxxxxxx
Subject: [SQLDownUnder] case statment in UPDATE STATEMENT
How can i incorporated a Select statement in Update statement?
UPDATE tblProducts SET Price= SELECT CASE Price WHEN 10 THEN 1.1 END
to unsubscribe to this list, please send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by http://www.readify.net
to unsubscribe to this list, please send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by http://www.readify.net
<<winmail.dat>>
(Click here for more information on the sqldownunder mailling list)
- Prev by Date: [SQLDownUnder] case statment in UPDATE STATEMENT
- Next by Date: [SQLDownUnder] SQL Server Sessions - 001
- Previous by thread: [SQLDownUnder] case statment in UPDATE STATEMENT
- Next by thread: [SQLDownUnder] SQL Server Sessions - 001
- Index(es):
