我好想知道怎么查询,要是我access一样简单就行了

解决方案 »

  1.   

    知道 了
    SELECT 表1.nmae, 表1.xuehao, 表2.id
    FROM 表1 INNER JOIN 表2 ON 表1.xuehao=表2.xuehao;
      

  2.   

    (select distinct c.title from cate c join posts p on c.id=p.fup order by c.id)
    union all
    (select distinct c.title from cate c left join posts p on c.id=p.fup where p.title is NULL order by c.id)
    ;
      

  3.   

    回复  loveflea(coolwind) Parse error: parse error, unexpected T_STRING in D:\www\ourtour\iline\index.php on line 30cate 表 qfdid = posts qfdid  //真实
    cate 表 id = posts fup //为了说明清楚些就用这个替代了$query=mysql_query("select distinct c.title,c.qfdid from cate c left join posts p on c.qfdid=p.qfdid order by c.id")union all("select distinct c.title from cate c left join posts p on c.qfdid=p.qfdid where p.title is NULL order by c.id");
      

  4.   

    这个是你的问题,php字符串的问题$query=mysql_query("(select distinct c.title from cate c join posts p on c.id=p.fup order by c.id) union all (select distinct c.title from cate c left join posts p on c.id=p.fup where p.title is NULL order by c.id)");