Questions tagged as 'sql'

1
answer

How to do GROUP BY in UNION ALL?

I have the following code: String select1 = @"SELECT CODIGOB, DESCRICAO, QUANTIDADE FROM " + path + @"\IVENDA.DBF WHERE DATA BETWEEN {^" + datainicial + "} AND {^" + datafinal + @"} "; String select2 = @"SELECT CODIGOB, DESCRICAO, QUANTIDADE...
asked by 28.03.2017 / 13:32
2
answers

Error formatting date:

Hello, I am formatting the date with the following code: Date data = null; SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { data = format.parse(request.getParameter("txtdata")); } catch (Exce...
asked by 27.05.2016 / 22:44
1
answer

SELECT Multiple Date Range in MySQL

Staff have a problem with extracting dates in a training range. What I need is the following if a training started on 01/01/2017 and its completion on 03/03/2017 elevate should return in the select below for the months 01.02 and 03. Today this s...
asked by 08.01.2017 / 23:07
4
answers

How to bring records of a LEFT JOIN even if it does not obey WHERE?

For example, I have tabela_A : cod nome 1 stack 2 overflow 3 stackoverflow and tabela_B : cod_tabela_A ano mes valor 1 2016 1 100 1 2016 2 115 2...
asked by 04.03.2016 / 17:42
1
answer

Delete all objects in a schema

I have a database on oracle where I need it delete all objects from a particular Schema , I can not delete the Schema , since the system validation is done based on an algorithm that takes into account the Schema ID .     
asked by 08.03.2016 / 13:53
1
answer

How to find the foreigner from one table to another by Oracle?

When we are executing SQL statements and we need to navigate between tables it is simple when we know the database modeling to apply JOIN and GROUP BY , but when we do not know, what to do? Is it necessary to apply DESC Table...
asked by 20.01.2016 / 12:51
2
answers

How to insert 200 new records? [closed]

I need to insert new data into one table, but there are many. I did like this: insert into pessoafisica (coluna1, coluna2, coluna 30) select (dado1 dado2 dado30) But there are many, you can not do 1 by 1. Could anyone help me?     
asked by 13.01.2016 / 15:02
1
answer

Using last_insert_id (), is it credible if multiple users are entering the database at the same time?

I have a question regarding the last_insert_id() method of mysql. And the following: I am creating a procedure to insert into 3 tables, example:    person (idPerson, first name, last name)       employee (idEmpregado, idPessoa, cargo)...
asked by 26.01.2016 / 14:48
1
answer

Java - How to validate user group in SQL and Save result?

Good morning, I have the following code in Java Desktop. I wanted to know how I can capture that user's group and save it to a variable. Since when it returns the value and stores in the variable "rs" does not contain information understood f...
asked by 30.11.2015 / 16:22
1
answer

NULL error when adding a new line

Good people, I have a bank as described in the image below: I have some questions: A) Uma geladeira da marca Brastemp 220 V que custa R$ 700. B) Três cadeiras de madeira em cores diferentes, cada uma custando R$ 53,40. Response:...
asked by 05.12.2015 / 01:29