hello everyone ,, I have problem when I run this command
select C.coursename, T.teacherid, T.teachername from teacher as T, course as C
group by C.coursename, T.teacherid, T.teachername;
error is appearing which is:
"SQL command not properly ended"
Could u please tell me what's a problem in it!!
"SQL command not properly ended"
Page 1 of 12 Replies - 2433 Views - Last Post: 10 May 2012 - 05:23 AM
Replies To: "SQL command not properly ended"
#2
Re: "SQL command not properly ended"
Posted 17 April 2012 - 04:43 AM
The "as" will probably throw it. Some databases do ";" at the end, some don't:
However, the problem now is you can see there is no "where" clause. A new SQL engine might choke on that. The comma thing really isn't standard. Using join syntax will high light what you need to do:
Also, the group by makes no real sense. Perhaps:
Hope this helps.
select C.coursename, T.teacherid, T.teachername from teacher T, course C group by C.coursename, T.teacherid, T.teachername
However, the problem now is you can see there is no "where" clause. A new SQL engine might choke on that. The comma thing really isn't standard. Using join syntax will high light what you need to do:
SELECT c.coursename, t.teacherid, t.teachername FROM teacher t INNER JOIN course c ON ??? GROUP BY c.coursename, t.teacherid, t.teachername
Also, the group by makes no real sense. Perhaps:
SELECT c.coursename, t.teachername FROM teacher t INNER JOIN course c ON t.teacherid=c.teacherid, ORDER BY c.coursename
Hope this helps.
#3
Re: "SQL command not properly ended"
Posted 10 May 2012 - 05:23 AM
Thanks a lot Baavgai..you were right
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote




|