I need to select a row from a table with a specific identifier, but if the row does not exist, I need to select the first row. is it possible to do this in one request?
Example: I have a table with identification and text fields. and I have 3 rows in the table
id txt ---------------- 1 text1 2 text2 3 text3
I need to select the first row if say SELECT * FROM myTable WHERE id = 4 does not exist. Else selects a row with id 4.
Headshota
source share