mercredi 23 décembre 2015

SQL When where x = y returns no rows, use x = z

I am not sure how to word this, so I wasn't sure what to google before posting this.

This will be done with SQLite as well.

Basically what I am trying to do is like this:

SELECT name FROM users WHERE Language = 'en'

If 'Language = 'en' returns no rows, change 'en' to 'fr'

I know I can achieve this by running the first query, checking result, and then trying the second one next, I thought there was probably a way to do this in a single query, as this would be alot better im my situation.

Aucun commentaire:

Enregistrer un commentaire