Posted by Ross Presser on 10/10/05 22:07
On 10 Oct 2005 10:19:34 -0700, Razvan Socol wrote:
> SELECT * FROM employees e
> WHERE EXISTS (
> SELECT * FROM (
> SELECT 'C' AS Prefix
> UNION ALL SELECT 'D'
> UNION ALL SELECT 'F'
> ) x WHERE e.LastName LIKE x.Prefix+'%'
> )
Is there any good reason why you wouldn't do this variation:
SELECT * FROM employees e
WHERE EXISTS (
SELECT * FROM (
SELECT 'C%' AS Pattern
UNION ALL SELECT 'D%'
UNION ALL SELECT 'F%'
) x WHERE e.LastName LIKE x.Pattern
)
Navigation:
[Reply to this message]
|