I need to know how to return a default row if no rows exist in a table. What would be the best way to do this? I\'m only returning a single column from this particular table
*SQL solution
Suppose you have a review table which has primary key "id".
SELECT * FROM review WHERE id = 1555 UNION ALL SELECT * FROM review WHERE NOT EXISTS ( SELECT * FROM review where id = 1555 ) AND id = 1
if table doesn't have review with 1555 id then this query will provide a review of id 1.