MySQL GROUP BY *RESOLVED*
I can't see why the following SELECT statement won't work - any ideas?
Code:
SELECT s.subject_id, s.subject_name
FROM tbl_subjects AS s
INNER JOIN tbl_lessons AS l
ON s.subject_id = l.subject_id
WHERE l.online = 'True'
GROUP BY s.subject_id, s.subject_name
ORDER BY s.subject_name ASC
The error I get is:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-3.23.55-nt]You have an error in your SQL syntax near 'BY s.subject_name ASC' at line 1
/html/newLogin.asp, line 23
Stumped again... :(
DJ
Re: MySQL GROUP BY *RESOLVED*
This works too....
Code:
SELECT VS.VS_Vessel, SS.SS_CarrierCode
FROM SS INNER JOIN VS ON SS.SS_RefNum = VS.VS_RefNum
GROUP BY VS.VS_Vessel, SS.SS_CarrierCode
ORDER BY SS.SS_CarrierCode ASC;
Why don't you try removing this line...
Code:
WHERE l.online = 'True'
Re: MySQL GROUP BY *RESOLVED*
What happened? Why is it resolved already? :confused:
Ooooppsss.... I missed Post #4. :D