Questions tagged as 'sql'

1
answer

SQL Sum for periods

I'm having a question for the following query: In my sales table I would like to return the sum by period of a given product. Today I'm doing it this way: select YEAR(venda.data_venda) as Ano, venda.codprod_venda as CodigoProduto, produtos....
asked by 05.09.2015 / 21:56
0
answers

Create Trigger / Stored Procedure Mysql to change characteristics of a column

I'm trying to create a Trigger / Stored Function for when the user changes the value of a column from 0 to 1 it changes the characteristic of another column CREATE TABLE 'aluno' ( 'CPF_ALU' varchar(11) NOT NULL, 'PRIORIDADE' tinyint(1) NOT...
asked by 17.06.2016 / 04:42
0
answers

How to assemble a structure starting from the same structure?

I have a lot of research on how to set up a query in sql server but I have not been very successful. First, I have a system that controls an industrial courtyard in which there are organizational levels and I have the structure that has the n...
asked by 11.11.2015 / 11:49
0
answers

Wildfly in production does not retrieve property values and SQL scripts

I'm using a development environment and another production environment, in the development environment using the concept of i18N (internationalization) is correctly retrieved for example the value of label.carro which is Carro , how...
asked by 12.11.2015 / 14:58
1
answer

"create temp table" in trigger in PostgreSQL

Is it possible to create an insert trigger in a "Table1" using "CREATE TEMP TABLE" in its structure and feed a "Table2"?     
asked by 02.06.2015 / 23:33
0
answers

Mysql Workbench 6.3 does not change the attribute data type in the table, always returns to the previous [closed]

Does anyone use the Designer Mysql Workbench tool in version 6.3? I'm having difficulty changing a datatype of a given attribute whenever I change it and I enter it back to the previous attribute ... Does anyone have the same problem? I think I'...
asked by 06.05.2016 / 02:40
1
answer

Script to Execute in Function

I'm doing a conversion on some bd objects where they have a fixed database name. Example: select * from banco.dbo.tabela ... In this case, we are exchanging this banco fixed, with a variable that contains the name in each database...
asked by 18.06.2015 / 15:07
2
answers

Foreign Key Error

I'm making a somewhat simple database for submitting a job and I'm encountering the same annoying problem. In the case we have two tables, funcionario[nome,cpf] and departamento[DNR,CPF do gerente] . Here is the code: CREATE SC...
asked by 08.05.2015 / 08:10
1
answer

Table Update Update Doubt

I have two tables, questions and answers, and I would like to update them according to what is selected: Bank Sql Server 2005 Problem: --usuário excluindo a pergunta (não está gravando a data da exclusão é não está excluindo as perguntas) u...
asked by 03.07.2015 / 04:28
0
answers

Duplicate States

How can I delete all duplicate states from Magento? This was due to the change in the checkout used.     
asked by 03.07.2015 / 19:44