sql - Subquery returns more than 1 row i dont know -


when trying "tytul" field catch error

   select f.*,        (select max(e) seriale s = max(k.s) , id_serialu = f.id) e,        max(k.s) s,        (select tytul seriale c c.s = s , c.e = e) tytul    serial f    left join seriale k on f.id=k.id_serialu    group f.id    order f.id desc    limit 25 

i think need aliases in subquery.

(select tytul seriale c c.s = f.s , c.e = f.e) tytul 

if don't that, s , e sought in closest scope, c, query interpreted as:

(select tytul seriale c c.s = c.s , c.e = c.e) tytul 

this returns more 1 row, since returns in table.

but aliases, of course work, if got @ 1 row per combination of s , e in seriale.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -