Questions tagged as 'sql'

2
answers

How to select in a table as if it were two registers

In the person table you have the following information ID | NOME | É_ALUNO | É_RESPONSAVEL 1 | ALUNO | TRUE | FALSE 2 | RESPON| FALSE | TRUE There is another table with the name responsavel_aluno , this table has t...
asked by 26.04.2018 / 03:28
3
answers

Problems with WHERE IN (many records)

I need to mount a query to fetch records in table A, with records filter from table B. Something like: SELECT * FROM tabelaA tblA WHERE tblA.coluna IN (1,2,3,...) The values contained in the "IN" filter come from table B and in some cases...
asked by 10.03.2015 / 13:32
1
answer

SQL History Query

I'm in need of a help with SQL. I need to do a query that returns me a history of the current date up to 7 days back. Could someone please help me?     
asked by 18.09.2014 / 14:26
3
answers

Remove repeated lines in all respects in Oracle [closed]

In a CADASTRO column I have two lines repeated in all respects: NOME ID EMAIL SEXO JOAO 1234 [email protected] M JOAO 1234 [email protected] M How to compare these two lines, check if all the columns are identical and d...
asked by 04.05.2017 / 21:18
1
answer

Why is my WHERE statement in MySQL not working?

I have the following SELECT, and in the WHERE clauses the amount of credit was only shown if > = 2, but even putting the condition, shows me everything. (fornecedor_credito.qtd_credito >= '2') AND (cadastra_oferta.qtd_estoque >= '2')...
asked by 22.07.2017 / 20:10
4
answers

Help with distinct

I have the following sql query: select nome, data, situacao from cadastro The result is like this: MARIA 01/01/2018 0 MARIA 15/01/2018 1 GISELE 15/01/2018 0 CICERA 08/01/2018 1 ANTONIA 20/01/2018 0 ANTONIA 15/01/2018 1...
asked by 29.01.2018 / 14:12
4
answers

How to return the sum of column business_value, month by month, based on column start_date?

I have the following table: IneedanSQLstatementthatreturnsthesumofthebusiness_valuecolumn,monthbymonth,basedonthestart_datecolumn.Example: I need the name of the month and the total to appear.     
asked by 03.11.2017 / 13:56
1
answer

Where are banks saved in SQL * Plus?

I downloaded SQL * Plus from the Oracle site, installed it (my notebook is Windows 10) I created a user and I already created some banks, but I do not know where it saves the banks I created. Where is it?     
asked by 15.09.2016 / 18:34
2
answers

Is there a similar clause similar to LIMIT in PL / SQL

I'm using PL / SQL and would like to know if you have any clause or sql script that is similar to the sql LIMIT clause, I've been searching here and found rownum < = X, but does not meet what I want to do. I'll try to explain SELECT select...
asked by 23.02.2018 / 16:04
3
answers

SQL - Calculate percentage in same select

I'm using SQL Server and I have the following query. I need to add the Percentage column. I need to calculate the percentage of Passed over Total but I do not know how to get the values of that same select to enter in the calcula...
asked by 15.03.2018 / 16:33