我有sql select:
SELECT *
FROM `fclients` AS F
LEFT JOIN `fclients_sequens` AS FS ON F.category = FS.category
ORDER by FS.num
我得到了结果:
result select sql http://i066.radikal.ru/1210/15/fa9c91a9d6b2.jpg
然后,对于第一个表中的给定id
,我进行sql查询:
SELECT *, fclients.id as fclientsID
FROM `fclients` AS F
LEFT JOIN `fclients_sequens` AS FS ON F.category = FS.category
ORDER by FS.num
我收到错误:
#1054 - “字段列表”中的未知列'fclients.id'
请告诉我如何给id拳栏(id = 37)?
答案 0 :(得分:8)
引用列ID
时,需要使用别名F.SELECT *, F.id...