求一个查询
我想把两个查询条件的结果集 表1 和 表2 连接起来
select left(p1,2) As X1,p2 ,p3 From 表1 A where 条件 group by lef(p1,2) join (select left(p1,2) As x1,t1 ,t2 From 表2 where 条件 group by left(p1,2)) B on A.X1=B.X1
总是提示我的join附近有错误
[解决办法]
select * from
(select left(p1,2) As X1,p2 ,p3 From 表1 where 条件 group by lef(p1,2)) A
inner join
(select left(p1,2) As x1,t1 ,t2 From 表2 where 条件 group by left(p1,2)) B
on A.X1=B.X1