select a.*,b.*,c.* from a,b,c

解决方案 »

  1.   

    我是说JOIN,有条件的JOIN,比如他们之间某一个字段有关联,哪位朋友有示例语句?谢谢
      

  2.   

    USE pubs
    SELECT a.au_lname, a.au_fname, t.title
    FROM authors a INNER JOIN titleauthor ta
       ON a.au_id = ta.au_id JOIN titles t
       ON ta.title_id = t.title_id
    WHERE t.type = 'trad_cook'
    ORDER BY t.title ASC
      

  3.   

    select * from a inner join b on b.x=a.x inner join c on c.x=b.x
      

  4.   

    select * from a join b on a.id=b.id join c on a.id=c.id
      

  5.   

    select * from a inner join b on a.id=b.id inner join c on a.id=c.id
      

  6.   

    select b1, b2, b3 from table1 join table2 on a1=a2 join table3 on a1=a3 where a1 not null
      

  7.   

    假设a:主表,b,c是从表 
    字段:
    a_b_id 对应b_id;
    a_c_id对应c_idselect * from a
    left outer join b on a.a_b_id = b.b_id
    left outer join c on a.a_c_id = c.c_id这样,保证a表的所有记录都至少出现一次
      

  8.   

    select t1.age,t2.name,t3.tel from t1,t2,t3
    where t1.id=t2.id and t2.id=t3.id