There are two types of results I want to return:
- Unread notifications
- Read notifications
If there are > 10 unread notifications available I want to select as many as there are
If there are <= 10, I want to select all (say there were 7) the unread notifications and 3 'filler' read notifications. How can I accomplish this?
If I wanted to just select all unread notifications my query would be:
SELECT * FROM notifications WHERE read = 0
If I wanted to just select all read notifications my query would be:
SELECT * FROM notifications WHERE read = 1