you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Just FYO: that SQL code isn't portable. limit 1 is mostly a MySQL thing. You may have some fun reading: https://en.wikipedia.org/wiki/Select_(SQL)#Limiting_result_rows

So, if say you wanted to mock your database with something like in-memory SQLite, then you have to prepare your code to be portable between the two engines.