hej, pomozcie bo juz troche sie glowie i nie moge rozwiazac tematu.
mam dwie tabele
a
id - name - url
i
b
id opis url isread
- ttt. www. 0/1
pole url laczy tabele a z b , w oby dwoch tabelach pola sie powtarzaja
chcialbym wypisac id, nazwe ale tez ilosc
id - name - ilosc
- name 1 10
- test. 3
mam takie zapytanie:
SELECT a.id,a.url,COUNT(DISTINCT(b.url)) FROM a left join b on b.url = a.url and a.isread = 0 GROUP BY a.url
jakies pomysly?