Can't seem to quite figure out what query I need to do what I want.
SELECT IFNULL(id, 0) as id1 FROM photo WHERE id < 3 LIMIT 1
UNION
SELECT IFNULL(id, 0) as id2 FROM photo WHERE id > 3 LIMIT 1
Essentially I want to return 2 columns, the first one being from the top query and the second one for hte bottom query. But then a union isn't what i want is it?
Then i tried to do a join
SELECT t1.id as id1, It2.id as id2
FROM photo as t1
JOIN photo as t2
WHERE t1.id > 2 AND t2.id < 2
But that didn't work either..
What is it I am looking for?
Trying to return the the row before and after a particular entry with 1 query as opposed to 2.