Jump to content

syntax error


vaaibhavmohan
 Share

Recommended Posts

select A.country,count(A.CustomerID) as N
from 
     (select country,Count(CustomerID) as N1 from customers group by country) as A
left join 
    (select country,Count(CustomerID) as N2 from customers group by country) as B 
     on A.N1=B.N2

 

the error:it is not reading A.customerid 

Link to comment
Share on other sites

  • 7 months later...

Try updating the code like this :

select A.country, count(A.N1) as N
from 
     (select country,Count(CustomerID) as N1 from customers group by country) as A
left join 
    (select country,Count(CustomerID) as N2 from customers group by country) as B 
     on A.N1=B.N2 group by A.Country

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...