Hi,
I need to do a JOIN on a COUNT, something like
Select awUser .*, count(awStuff.strUser) as WorkCounting from awUser LEFT JOIN ON awUser.uid = awStuff.strUser order by WorkCounting group by awUser.uid
but I just can't get it to work at all, anyone has an alternative?
Originally posted by 90Nz0 Hi, I need to do a JOIN on a COUNT, something like Select awUser .*, count(awStuff.strUser) as WorkCounting from awUser LEFT JOIN ON awUser.uid = awStuff.strUser order by WorkCounting group by awUser.uid but I just can't get it to work at all, anyone has an alternative?
not sure if MYSQLQ is relaly picky about it, but would the space between awUSer and .* be causing your problem? (I would think between table and column names there should be no spaces when doing multi table selects)
Sorry, I didn't copy'n'paste the statement, as I tried loads.
I actualy did have it without the space.
On MySQL.com , there are no examples with the JOIN syntax.
worst comes to it, i'll have to use PHP.
When posting a question, show the exact sql in question and error received.
Your sql is not working because it is rife with syntax errors. The manual has examples with the JOIN syntax.
Every table field in the 'SELECT' has to be included in the 'GROUP BY'. Drop the 'ORDER BY' until you get it working, it may have to go after the 'GROUP BY'?