Gonçalo Ferreira Posted June 19, 2009 at 05:36 PM Report Share #273671 Posted June 19, 2009 at 05:36 PM Olá a todos, Tenho uma dúvida basica, mas n estou a conseguir resolver, Fiz um dado select e fiquei com uma dada lista, pretendia saber qual é o item que se repete mais vezes nessa dada lista, COMO POSSO FAZER ISSO, Obrigado Link to comment Share on other sites More sharing options...
bruno1234 Posted June 19, 2009 at 07:19 PM Report Share #273677 Posted June 19, 2009 at 07:19 PM select top 1 with ties A, Count(A) as count from T group by A order by count desc Tens aí um exemplo para sql server. O with ties serve para caso haja 2 iguais aparecerem os 2, se n puseres aparece só 1. Matraquilhos para Android. Gratuito na Play Store. https://play.google.com/store/apps/details?id=pt.bca.matraquilhos Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now