Query that adds a blank line to the result set if the original resultset has more than one line

WITH Base AS (
    -- Your original query here
    SELECT col1, col2, col3
    FROM YourTable
)
SELECT col1, col2, col3
FROM Base
 
UNION ALL
 
SELECT '' AS col1, '' AS col2, '' AS col3
FROM Base
HAVING COUNT(*) > 1;   -- Only add blank row when >1 rows

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences