Questions tagged as 'sql'

2
answers

Period variable data SQL Server

Below I have the following code where I search in a table all the data within the specified period in the declared variables. However, a specific customer has a different month closure, in which case his month starts on the 26th, and ends on the...
asked by 02.08.2017 / 15:36
1
answer

1060 - Duplicate column name 'NULL' in a MySQL query

I'm trying to run this query, and it always gives me the following error: 1060 - Duplicate column name 'NULL' INSERT INTO ce_coins_issued (idc, idu, year, ltr, issuing, status) SELECT * FROM (SELECT 2,1,2002,NULL,NULL,'wallet') AS tmp WHERE...
asked by 30.07.2017 / 14:55
3
answers

How to create an incremental Update sql command

I have a Estoque table where today there are already many rows of records already registered, how can I do an incremental update to populate a column that added the table now? Produto | N_Serie | Etiqueta A | 123 | NULL...
asked by 27.07.2017 / 15:16
2
answers

Limit result to a random

I use the query SELECT * FROM mpbbolao WHERE eTIME1>=2 LIMIT 1 for example. To get a query result I use LIMIT 1 . How can I randomize what this "1" result will be?     
asked by 21.10.2017 / 20:38
2
answers

Case no order by

I'm trying to make an order by the result of sql: sql.... order by cod_rua, case cod_lado when 'M' then cod_lado desc else cod_lado ASC end, cod_altura Only you are giving error in desc. Staff did not work: order by r.cod...
asked by 04.05.2017 / 19:18
1
answer

Oracle, parameters of an Owner's procedures

In Oracle what table or view of the metadata I have in the parameters of a Procedure. My question is, does procedures have parameters with the name resembling "XPTO"? I tried the "dict" but did not find it.     
asked by 04.10.2017 / 18:09
1
answer

Query query - SQL Server 2012

Good afternoon! Well, I do not know if that's possible, but I wanted to know how I can get a one line record to stay on another line. I will illustrate. In the query below is coming out like this. Projeto Operador...
asked by 04.08.2017 / 19:18
2
answers

Regular Expressions in Oracle

'Select from the CITIES tables only records with compound names separated by a single space' TABLE CIDADES ID CIDADE 01 SAO PAULO 02 RIO DE JANEIRO 03 SAO CARLOS 04 TAUBATÉ 05 SÃO JOSÉ DO RIO PRETO Query can only return TABLE CIDAD...
asked by 31.03.2017 / 14:54
1
answer

Group Mysql result in PHP

I have two tables in my database, the cad_usuario and the cad_automovel . The user registered in the first table can have several vehicles registered in the second table. SELECT aut.usuario_id, aut.marca, aut.modelo, aut.ano, usr....
asked by 11.04.2017 / 00:57
1
answer

How to do a percentage calculation in Oracle?

I can not make a Select that can do 1 IPI calculation in Oracle. Table VS01 Fields: PD = 001 TP = 100 reais IPI = 15 Select PD,TP,IPI, TP * IPI% AS TOTAL <<< aqui que não consigo executar From VS01 PD || TP |...
asked by 28.03.2017 / 14:51