Skip to content
Advertisement

How can the same function be provided without using the row_number() function in sqlite?

The query below is working perfectly well if the user’s phone supports sqlite version 3.25.0 or higher. Otherwise, as you can guess, the query doesn’t work. How can I transform the code, without using the row_number () function?

The database’s ER diagram: enter image description here

The expected result: enter image description here

Advertisement

Answer

I would expect recipes to have unique names. If so, then the outer quer is simply not needed:

If recipes can have duplicated names, then you can use a correlated subquery:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement