WITH rawdata(color) As ( SELECT 'Blue' UNION ALL SELECT '...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

-- Enter Query Title
-- Enter Query Description
WITH rawdata(color) As
(
SELECT 'Blue' UNION ALL SELECT 'Red'
), rules(color_condition,rules_id) AS
(
SELECT 'B%',1
)
SELECT color FROM rawdata 
WHERE color LIKE (SELECT TOP 1 color_condition 
                  FROM rules WHERE rules_id=1)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached