Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ULOHA 2
- select z.zid, z.nazev, (
- select count(nizsi.cena) from (
- select po.cena from polozka po
- join zbozi zb on zb.zid = po.zid
- where po.cena < zb.aktualni_cena and zb.zid = z.zid
- ) nizsi
- ) as nizsi,
- (
- select count(vyssi.cena) from
- (
- select po.cena from polozka po
- join zbozi zb on zb.zid = po.zid
- where po.cena >= zb.aktualni_cena and zb.zid = z.zid
- ) vyssi
- ) as vyssi
- from zbozi z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement