От: | vmpire | ||
Дата: | 20.10.09 19:22 | ||
Оценка: | 63 (2) +1 |
S>SELECT
S> *
S>FROM [dbo].[Table] AS Table
S>WHERE Table.Id ???
S>CASE
S> WHEN @Flag <> ''
S> THEN ( 1, 2, 3 )
S> ELSE (4, 5, 6)
S>END
S>
WHERE (@Flag <> '' AND Table.Id IN (1, 2, 3)) OR (@Flag = '' AND Table.Id IN (4, 5, 6))