I have this simple query
select * from users where name = 'User1'
I'd like to extend the query's functionality whatever the query returns 0 records the query will fetch the data by other clause.
where name = 'Default'
If the first clause will fetch some records the second clause will be ignored.
EDIT
Oracle
SELECT * FROM users WHERE name = 'User1'
UNION ALL
SELECT * FROM users WHERE name = 'Default'
AND NOT EXISTS (SELECT 1 FROM users WHERE name='User1')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With