房天下 > 房天下问答 > 业主生活 > 其他
  • 查找SQL语句中的错误

    显示文章、提交人和最后回复时间select a.title,a.username,a.adddate from a,(select max(addddate) adddate from table where table.title=a.title)b上式有错么?如果没有请解释下为什么这么写

    提问者:fxg_2010

    发布于2010-08-20

共1个回答
  • 心动的小屋 丨Lv 4
    以下两种都可以 ,你那样错了是因为from子句中的子查询不能和from子句中其他的表相关联select a.title,a.username,a.adddate from a,(select title,max(addddate) adddate from [table] group by title)bwhere b.title=a.titleselect title,username,(select max(addddate) adddate from [table] where [table].title=a.title)from a
    +1 2010-08-20 举报
热门人气推荐
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。