56,677
社区成员
发帖
与我相关
我的任务
分享
mysql> select * , ( select owner from terminal where terminal.id = terminalinfo.terminal limit 1 ) as userid from terminalinfo where InfoType > 2;
+----+----------+----------+---------+--------+--------------------------------+----------+---------------------+--------+
| ID | InfoType | Terminal | PrgType | PrgPos | FileDir | FileSize | FinishTime | userid |
+----+----------+----------+---------+--------+--------------------------------+----------+---------------------+--------+
| 1 | 20 | 422 | 0 | 0 | 0=JH-A3,1=0,2=512,3=64,4=2,5=2 | 0 | 2014-03-15 12:32:26 | 81 |
+----+----------+----------+---------+--------+--------------------------------+----------+---------------------+--------+
select * , ( select owner from terminal where terminal.id = terminalinfo.terminal limit 1 ) as userid from terminalinfo where find_in_set(userid,'81,82') and InfoType > 2;
1054 - Unknown column 'userid' in 'where clause'
mysql>
select ( select * , ( select owner from terminal where terminal.id = terminalinfo.terminal limit 1 ) as userid from terminalinfo where InfoType > 2 ) where find_in_set(userid,'81,82') ;
这样写不对.