SQL Help!!!

Results 1 to 2 of 2

Thread: SQL Help!!!

  1. #1
    Join Date
    Dec 1969

    Default SQL Help!!!

    I am having error with this SQL. Can someone tell me why?<BR>I am using MySQL version 4.0.13.<BR><BR>SELECT t1.keepID, t2.keepHistID, t2.custName, t2.keepDate, t2.keepTime FROM liquor_keep AS t1 LEFT JOIN (select max(lh.keepDate) as keepDate, max(lh.keepTime) as keepTime, max(lh.keepHistID) as keepHistID, lh.keepID, lh.custName from liquor_history lh group by lh.keepID, lh.custName) AS t2 ON t1.keepID = t2.keepID <BR><BR>I keep getting error near "SELECT max(lh.keepDate) AS keepDate"...

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL Help!!!

    now, I&#039;m not 100% sure about this, but I&#039;m not 100% you can do a JOIN against a subquery in MySQL (though I may be wrong, I don&#039;t use it much)<BR><BR><BR>j<BR>http://rtfm.atrax.co.uk/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts