sql Column 'id' in order clause is ambiguous

编写数据库查询语句时候报错,发现语句正确啊.

 

 

select j.date,m.daily_id, m.meeting_time,m.next_meeting_time,m.result,m.recommend_insurance,m.credit,m.premium from bb_app.journal_daily_meeting as m inner join bb_app.journal_daily as j on m.daily_id=j.id  where m.cid=:cid  and m.status & 0 = 0 order by id desc  limit 0,20

 程序执行就会报错。改成下面就不会报错。

 

select j.id,j.date,m.daily_id, m.meeting_time,m.next_meeting_time,m.result,m.recommend_insurance,m.credit,m.premium from bb_app.journal_daily_meeting as m inner join bb_app.journal_daily as j on m.daily_id=j.id  where m.cid=:cid  and m.status & 0 = 0 order by id desc  limit 0,20

 不是很理解。

你可能感兴趣的:(column)