Questions tagged as 'sql'

2
answers

Return records totaling desired value

I have a table in this format, with more N values and N vendors, approximately 100,000 records, and I need to do through a query or a plpgsql function a way to get all the launch numbers num where the sum of valor_conta is 0 (zero)...
asked by 26.06.2017 / 17:52
1
answer

(SQL) Add "count 0" when you do not have a record

Hello, I'm picking up a query in the database where I need to get how many subscribers have registered in a tournament, the problem is that I also need to bring the tournaments that do not have subscribers yet ... I can not think of the logic by...
asked by 07.05.2018 / 19:21
2
answers

Login form returning error!

I have a login form that returns the following ERROR :    You have an error in your SQL syntax; check the manual that   correspond to your MySQL server version for the right syntax to use   near 'as value FROM olmp_cadparaprova WHERE email =...
asked by 30.10.2017 / 11:22
1
answer

SQL - How to make multiple INSERTs in a table with the result of a SELECT * of another table in a query

Hello, I would like to know how to make multiple INSERTs in a table with the result of a SELECT of all ids of another table table that are not as foreign key in the first table. I already have the SELECT query with LEFT JOIN: SELECT id FROM...
asked by 30.10.2017 / 14:28
2
answers

Help with join in two different selects

I have two select (somewhat complex) commands. First code: select A.no_cidadao NOME, F.no_equipe UNIDADE from tb_cds_cidadao_resposta E, tb_cds_cad_individual A, tb_cds_prof as G, tb_pessoa_fisica as H, tb_equipe as F where A.co_seq_cds...
asked by 31.10.2017 / 15:44
2
answers

Dynamically sort SQL result

First of all, Working specifically with Java in the Backend using WebServices Rest and PostgreSQL, after some professional enhancements I was directed to pass ordering and paging of my application to SQL, which would overload the application ser...
asked by 18.09.2017 / 21:26
1
answer

Add a Character to the value of a column

I would like to know if you can include a character set at the end of a column's data. For example: 'Coluna 1- Quantidade |10000 |20000 |15000 |20000 I want to extract a query where I can display this data with a character after the...
asked by 29.08.2017 / 21:19
1
answer

DataBindTable Incompatible with SqlDataReader does not implement IEnumerable

___ erkimt ___ DataBindTable Incompatible with SqlDataReader does not implement IEnumerable ______ qstntxt ___ I have a problem displaying the data in a column that is in the
asked by 12.04.2017 / 12:08
2
answers

SQL with 2 of several conditions

I'm having trouble making a Select that meets the 2 or 3 conditions of several selected, for example: Conditions: - Cidade Tal (São Paulo) - Nome Tal (João) - Sexo (Masculino) - Fumante (Não) - Carro Próprio (Sim) I want everyone to meet wi...
asked by 20.02.2017 / 22:42
1
answer

Insert and fetch data in the database per user with Laravel

I need to save information to the database by logged in user. That is, when the user logs in, everything he does will save to the login database. That is, when user X logs in, everything he saves in the database will refer to him (user X)....
asked by 18.02.2017 / 22:29