我收到以下内容:
查询错误:
错误:语法错误在或附近"选择"第4行:(选择remoteaddr, count(remoteaddr)remoteaddrCount
Select Tim1.remoteaddr,Tim1.remoteaddrCount, Tim2.domain_id
From domain_visitors
(Select remoteaddr, count(remoteaddr) remoteaddrCount
From domain_visitors
Group by remoteaddr
Having count(remoteaddr)>500) Tim1,
(Select distinct remoteaddr, domain_id
From domain_visitors) Tim2
Where Tim1.remoteaddr=Tim2.remoteaddr
答案 0 :(得分:0)
在domain_visitors
之后和子查询之前,似乎您有一个热情的表名From
。
让我们再试一次
Select Tim1.remoteaddr,Tim1.remoteaddrCount, Tim2.domain_id From
(Select remoteaddr, count(remoteaddr) remoteaddrCount From domain_visitors Group by remoteaddr Having count(remoteaddr)>500) Tim1
JOIN
(Select distinct remoteaddr, domain_id From domain_visitors) Tim2 ON Tim1.remoteaddr=Tim2.remoteaddr
希望这个答案可以帮到你。
答案 1 :(得分:0)
您在FROM
的第一个表格与创建Tim1
的表达式
Select Tim1.remoteaddr,Tim1.remoteaddrCount, Tim2.domain_id
From domain_visitors, -- <-- MISSING COMMA
(Select remoteaddr, count(remoteaddr) remoteaddrCount
From domain_visitors
Group by remoteaddr
Having count(remoteaddr)>500) Tim1,
(Select distinct remoteaddr, domain_id
From domain_visitors) Tim2
Where Tim1.remoteaddr=Tim2.remoteaddr