msi
04-04-2004, 22:36
Hallo,
ich habe eine mysql query in der art:
select t1.name,count(t2.tid) from table1 as t1 left join table2 as t2 on t1.id=t2.tid group by t1.id
das funktioniert auch wunderbar, wenn ich das count allerdings bei where reinbringe scheitert er und sagt mir, dass ich group by nicht richtig verwende:
select t1.name from table1 as t1 left join table2 as t2 on t1.id=t2.tid where count(t2.tid)<2 group by t1.id
woran liegt das? mach ich irgendwas falsch oder kann mysql das einfach nicht?
danke Markus
ich habe eine mysql query in der art:
select t1.name,count(t2.tid) from table1 as t1 left join table2 as t2 on t1.id=t2.tid group by t1.id
das funktioniert auch wunderbar, wenn ich das count allerdings bei where reinbringe scheitert er und sagt mir, dass ich group by nicht richtig verwende:
select t1.name from table1 as t1 left join table2 as t2 on t1.id=t2.tid where count(t2.tid)<2 group by t1.id
woran liegt das? mach ich irgendwas falsch oder kann mysql das einfach nicht?
danke Markus