sql - Coun(*),distinct and column -


how accomplish in sqlserver

select firstname,count(*) (select distinct firstname,lastname,amount  emp) group firstname 

this works in oracle.

i don't understand trying do, query written way:

select firstname, count(*)  emp group firstname; 

or:

select firstname, count(*)   (   select distinct firstname, lastname, amount    emp ) t group firstname; 

you can use distinct keyword inside count; this: count(distinct columnanme) instead.


or:

select firstname, lastname, amount, count(*) emp group firstname, lastname, amount; 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -