房天下 > 房天下问答 > 业主生活 > 其他
  • sql语句多表联查问题

    一共有4个表:news_info,news_class,city_info,user_infonews_info 字段:id,news_tit,news_content,addDate,tj,city_idnews_class 字段:id,news_class,news_class_fid,news_class_px,user_idcity_info 字段:id,city,fiduser_info 字段:id,username,userEmail先添加 news_info表 8条新闻数据,user_info表3条用户数据, city_info表 5个城市news_class 表4条数据后查询 news_info 里的news_tit,news_content , news_class里的news_class city_info 里的city user_info 里的username,useremail多谢了!

    提问者:zyang63

    发布于2011-01-15

共1个回答
  • 孙凯文 丨Lv 0
    select a.news_tit,a.news_content ,b.news_class,c.city,d.username,d.useremailfrom news_info a,news_class b,city_info c,user_info dwhere a.city_id=c.id and b.user_id=d.id and a.id=b.news_class_fid你看一下这样可不可以
    +1 2011-01-16 举报
热门人气推荐
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。