Msg#: 3604107 posted 3:17 pm on Mar 18, 2008 (gmt 0)
Hi I have an ENUM value for "orderStatus", there are dozens of different statuses and instead of using a number for each status I used a string to help describe each status.
So with a simple example
orderStatus can be Order Started In Production Paid Shipped
What is the shortest way to select certian orderStatuses in a select statment.
Right now i have: SELECT * FROM orders WHERE orderStatus = 'Order Started' OR orderStatus = 'In Production' OR orderStatus = 'Paid';
Is there a way to only refer to the "orderStatus" column once and give it a bunch of different possible values? The following syntax dosn't work but this would be the idea SELECT * FROM orders WHERE orderStatus = ('Order Started','In Production','Paid');
I know it dosn't seem to be a huge time saver in this example, but if i have dozens of different statuses and several selects every script it adds up.