Hi all, I need your important help.
Why this query is wrong?
The column `name` is selected in the query or not ?
Many thanks
Code:mysql> UPDATE `tb1` t JOIN( SELECT name, DATEDIFF(CURRENT_DATE(), `maxdata`) `dateDiff` FROM ( SELECT name, MAX(`myDates`)`maxdata` FROM tb2 GROUP BY name ORDER BY `maxdata` ASC )q )x SET t.GG = q.`dateDiff` WHERE t.name = q.name; 1054 - Unknown column 'q.name' in 'where clause'



Reply With Quote




Bookmarks