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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 using where and or statements

Author  Topic 

rob41
Yak Posting Veteran

67 Posts

Posted - 2011-01-19 : 18:46:41
how would i write a select to select to do the following, only show ACTION = SHIPMENT AND DESCRIPTION = UNASSIGN AND DELETE, AND SHIPMENT DELETED


OBJECT ID OBJECT TYPE ACTION DESCRIPTION
12345 SHIPMENT SHIPMENT DELETED
67891 ORDER SHIPMENT DELETED
11121 ORDER UNASSIGN AND DELETE ORDER - BUY
31415 ORDER SHIPMENT DELETED
16171 SHIPMENT UNASSIGN AND DELETE ORDER - BUY
81920 SHIPMENT SHIPMENT DELETED
21222 SHIPMENT UNASSIGN AND DELETE ORDER - BUY
32425 SHIPMENT SHIPMENT DELETED

Skorch
Constraint Violating Yak Guru

300 Posts

Posted - 2011-01-19 : 19:11:01
It's difficult to tell which columns are which but here is my guess:

SELECT * FROM YourTable
WHERE [OBJECT TYPE] = 'SHIPMENT'
AND [ACTION DESCRIPTION] IN ('UNASSIGN AND DELETE ORDER - BUY', 'SHIPMENT DELETED')


Some days you're the dog, and some days you're the fire hydrant.
Go to Top of Page

RobertKaucher
Posting Yak Master

169 Posts

Posted - 2011-01-19 : 20:23:43
Yes, we really need better column defs here.

===
http://www.ElementalSQL.com/
Go to Top of Page
   

- Advertisement -