我用MySQL试了一下:我明白了:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQLserver version for the right syntax to use near 'W
嗨,我想问一下,如果可能的话,在where子句中调用select,例如HELPER1将用作WHERE HELPER1 LIKE 'SAMPLE%'SELECT dispatch_idWHERE uid=helper4_id) as hp4,
(SELECT fullname FROM dev.tpl_user_profiles WHERE uid=helper5_id) as hp5WHERE uid=drive
我从这个查询中得到了未知的列异常 SELECT sessions.*, sessions.id AS session_id FROM sessions WHERE session_id = 1; 上面写着“未知的列session_id” 但我已经提到"session_id“是"sessions.id”的别名。我不能更改where条件。我只能更改选择部分。因为实际的查询太复杂了,我
似乎我不能在WHERE子句中使用计算值?SELECT id, TIMESTAMPDIFF(YEAR,dateOfBirth,CURDATE()) AS age WHERE age >= 20
我得到了ERROR 1054(42S22): Unknown column 'age' in 'where clause'。一个可能的解决办法是使用子查询,但它过于复杂?