How to give count to a limited value, "count up to 90 in a table that has 100"

-1

I have set the following Query - "INFORMIX"

SELECT COUNT(1) FROM (SELECT * FROM NOTA_FISCAL_NFE LIMIT 90);

That returns me the following error:

  

An error occurred when executing the SQL command: SELECT COUNT (1) FROM   (SELECT * FROM NOTA_FISCAL_NFE LIMIT 90);

     

A syntax error has occurred. [SQL State = 42000, Errorcode DB = -201] 1   statement failed.

     

Execution time: 0.02s

I want to make a count in a table up to a specific value, even if it has more records, I just want to know if it has that specific amount, in example "90".

    
asked by anonymous 13.04.2018 / 16:29

1 answer

-1

It would be nice if you specify the database you are working on. Generally you need to specify an alias when doing a subquery. Another thing, replace the '1' with a '*' or the name of a column.

select count(*) 
from (
    select * from NOTA_FISCAL_NFE limit 90
) as tabela_subquery;
    
13.04.2018 / 16:47