我现在有两个表
第一个表为
id title content
1 34234 234234第二个表为id Tcontent time tab1ID
1 嘉陵江 2009-1-1 1怎样把表二的time加入表一 然后select排出time的升序我连接两表都搞晕了 请大大们帮帮忙
第一个表为
id title content
1 34234 234234第二个表为id Tcontent time tab1ID
1 嘉陵江 2009-1-1 1怎样把表二的time加入表一 然后select排出time的升序我连接两表都搞晕了 请大大们帮帮忙
from 第一个表 a ,第二个表 b
where a.id=b.tab1ID
order by b.time
from 第一个表 a inner join 第二个表 b on a.id=b.tab1ID
order by b.time
from A1 a inner join A2 b on a.id=b.tab1ID
order by b.time
from a , b
where a.id=b.tab1ID
order by b.time
from 表1 a inner join 表2 b on a.id=b.tab1id
order by b.time 以上方法可以查出 但是如果表2没有记录 查询的结果是空 有没有办法查出如果b.time为空自动加上“空” 然后表1的记录依然显示啊。各位帮帮忙!!
from 表1 a left join 表2 b on a.id=b.tab1id
order by b.time 建议提问时一次性把所有情况列出来。举例说明也是一种学问。