select a.subject as title, a.itemid as id from table_a as a left join table_s as s on a.id = s.itemid;
s 有itemid这个字段吗?
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a.itemid as link from
我觉得是你的left join语法有错误。lz自己检查一下例子: SELECT * FROM b JOIN a LEFT JOIN c ON (c.key=a.key) LEFT JOIN d ON (d.key=a.key) WHERE b.key=d.key;
select s.subject as title, a.filepath as bUrl, a.thumbpath as sUrl a.itemid as link from notes_attachments a left join notes_spaceitems s on a.itemid = s.itemid order by a.dateline desc 这是原句把a.itemid as link 去掉能正确查询
select s.subject as title, a.filepath as bUrl, a.thumbpath as sUrl,a.itemid as link from notes_attachments a left join notes_spaceitems s on a.itemid = s.itemid order by a.dateline desc
select a.subject as title, a.itemid as id from table_a as a left join table_s as s on (a.itemid = s.itemid);
FROM b JOIN a LEFT JOIN c ON (c.key=a.key) LEFT JOIN d ON (d.key=a.key)
WHERE b.key=d.key;
这是原句把a.itemid as link 去掉能正确查询
from table_a as a left join table_s as s on (a.itemid = s.itemid);