Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select distinct agent, count(customer) as total_customer,
- (select count(january_1) from salestable where january_1!=0 group by agent) as sales_customer
- from salestable
- where customer_type = "urban"
- group by agent
- order by agent asc
- more than one row returned by a subquery used as an expression
- more than one row returned by a subquery used as an expression
- select agent,
- count(customer) as total_customer,
- count(case when january_1 <> 0 then 1 end) as sales_customer
- from salestable
- where customer_type = "urban"
- group by agent
- order by agent asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement