先建立临时表再查询、从临时表查询

先建立临时表再查询

with AAA(ENODEB_ID,EARFCN)as 
(
  select distinct A.ENODEB_ID,A.EARFCN
  from tbcell as A, tbCell as B
  where A.ENODEB_ID=B.ENODEB_ID and (A.longitude<>B.longitude or A.latitude<>B.latitude) and A.EARFCN=B.EARFCN 
)
select *
from tbcell
where tbcell.ENODEB_ID in (select AAA.ENODEB_ID from AAA) and EARFCN=38400

从临时表查询

            select a.GXID, a.GYID, a.ReceivedPowerdbm
            from 
            (select GXID, GYID, max(ReceivedPowerdbm) ReceivedPowerdbm 
            from tbGridPathloss  where GXID between 790 and 1050
            and GYID between 977 and 1317  group by gxid, gyid
            having max(ReceivedPowerdbm) > -130 ) as a(gxid, gyid, ReceivedPowerdbm)
            order by gxid, gyid
阅读更多
版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/u012319493/article/details/51539109
个人分类: Sql
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

先建立临时表再查询、从临时表查询

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭