Skip to content
Advertisement

sqlite return same value on left join

in below my sqlite command i want to get count of barcoeds when that’s equals with sessions.id

this command works, but that return more data with same value, for example if data is one, that return more than 3, but really i have one row

Advertisement

Answer

I think you want one row per session. So, your query is aggregating by the wrong column:

You might find this also easy to do with a correlated subquery:

The use of table aliases in these queries makes them easier to write and to read.

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