Does not return the number of records in the PostgreSQL database

1

I would like to know how many records in my database, but do not return the quantity.

Look at the records in my database

SQLcommand

Selectcount(*)ascontaRegistrosfromtb_produtoswhereprod_nomelike'%"+  +"%';

Result

    
asked by anonymous 30.10.2017 / 19:52

1 answer

1

Just do it this way:

Select count(*) as contaRegistros from tb_produtos;

Not working because of your where:

where prod_nome like '%"+  +"%';

You may have copied it from some code snippet in the wrong way.

If you need to search for some value, do this, let's assume that the value searched is 'test':

Select count(*) as contaRegistros from tb_produtos where prod_nome like '%teste%';
    
30.10.2017 / 19:55