varghesedxb Posted July 9, 2008 Share Posted July 9, 2008 when i am running this query iam getting the following error: select trxtal.groupno as groupn,artwork.artworkno as artworkno,count(trxtal.groupno) as grp from trxtal, mstcus LEFT JOIN artwork ON (trxtal.groupno=artwork.groupno and trxtal.classcode=artwork.classcode) where trxtal.groupno=mstcus.groupno group by mstcus.groupno having sum(artwork.artworkno)>0 #1054 - Unknown column 'trxtal.groupno' in 'on clause' This query was working fine before with my old version of mysql, when i upgarde i am getting this error....pls help MYSQL version:5.0.51b Apache version :2.2.8 PHP version: 5.2.6 Quote Link to comment Share on other sites More sharing options...
fenway Posted July 9, 2008 Share Posted July 9, 2008 Use: select trxtal.groupno as groupn,artwork.artworkno as artworkno,count(trxtal.groupno) as grp from (trxtal, mstcus) LEFT JOIN artwork ON (trxtal.groupno=artwork.groupno and trxtal.classcode=artwork.classcode) where trxtal.groupno=mstcus.groupno group by mstcus.groupno having sum(artwork.artworkno)>0 But really, don't use commas to join tables... it's very bad form. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.