mysql数据库
a 表
id  title  content
1    aa     yy
2    bb      llb表id2  title    url
3    aa       cc 
5     bb       dd
我想要的结果是title   content   urlaa       yy        cc
bb        ll       dd

解决方案 »

  1.   

    select a.title,a.content,b.url from a,b where a.title=b.title
      

  2.   

    怎么觉得你表设计的不对呢,难道外键是title而不是id?
    不会重名吗?
      

  3.   

    SELECT * FROM  yx_about,yx_two_daohang where yx_about.dh_two_name=yx_two_daohang.dh_two_name
      

  4.   

    select a.title,content,url from a inner join b on a.title=b.title.
      

  5.   

    都用inner join的话一个表没有数据的时候就出不来了,
    用LEFT OUTER JOIN ON
      

  6.   

    select c.title,c.content,d.url from 表a c
    left join 表b d on c.title=d.title 接分  
      

  7.   


    select a.*,b.url from a left join b where a.title=b.title
      

  8.   

    从楼主的例子看不出用inner还是outer,
    因为楼主没说如果一个表有,另一个表没有的时候如何显示。。