Advertisement
Guest User

Untitled

a guest
May 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. SELECT *
  2. FROM(SELECT p.id "pond", count(p.id) "liczba"
  3. FROM ducks d left join ponds p on d.pond_id = p.id left join species s on s.id = d.species_id
  4. where (temp_preferences = '+' and temp_limit>=temperature) or (temp_preferences = '-' and temp_limit<=temperature)
  5. group by p.id) as tab
  6. order by pond;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement