Sql incorrect syntax -


select max(qtd)  (select count(int_re_usu) qtd tb_questionario_voar_resposta) 

why query dont work? want retrieve max value count

it says incorrect syntax near')'

any ideias?

you need alias on derived table:

select max(qtd)  (     select count(int_re_usu) qtd      tb_questionario_voar_resposta ) 

but vincent pointed out, returns 1 row, , think missing group by. can do:

    select max(count(int_re_usu)) qtd      tb_questionario_voar_resposta     group somecolumn 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -