I'm not sure how to do what I need to do, here. Basically, I need to do a query that results in a number, then based on that number I need to run another query that returns a recordset. In a nutshell:
The individual queries work fine, but they don't work when I put them together. Am I just going at this wrong? Thanks!
Code:
SELECT CASE
WHEN (SELECT MAX(LENGTH(a)) FROM A)>0
THEN (SELECT b,c FROM B ORDER BY b)
ELSE (SELECT c,d FROM C ORDER BY c)
END