sql两表查询语句

来源:百度知道 编辑:UC知道 时间:2024/06/09 04:17:33
表a
表b
查询表a里,article=1和表b里,article=1的所有字段的值
该SQL语句该如何写?
初学SQL请高手指教?
sql语句知道如何写了,可是输出出错了
为何要么输出
<%=ors("a.article")%>
要么输出
<%=ors("b.article")%>

select top 5 * from a,b where a.article=1 and b.article=1

你想要表达什么意思?实现什么?

我也学了不久,不知道对不对
你是想两个表连起来的吗?是的话下面:
select a.*,b.*
from a,b
where a.article=1 and b.article=1 and a.article=b.article

select * from 表a ,表b where article=1
查的是 只要=1的

select * from a,b where a.article=1 and b.article=1 这个查的是2个同时=1的

select top(5)* from a,b where a.article=1 and b.article=1;