Questions tagged as 'sql'

1
answer

SQL Server performance loss with insert in sequence

I have a .Net C # application that takes data via Web Service and saves it to a SQL Server 2012 database. The initial performance is 20 records per second. After having a 10000 records in the table, the performance begins to fall, gradually, rea...
asked by 09.09.2014 / 21:59
1
answer

Why Oracle does not have autoincrement?

Assuming that Oracle is known to have the capabilities of the sequence table. I would like to understand why I recently implemented autoincrement in Oracle, since it was an existing feature in competitors (SQL Server, MySQL). What motivat...
asked by 01.11.2017 / 13:23
2
answers

Add previous row in mysql

I have a launch line, in which this line would need to receive the value of the previous line +1, some example of how to do this? Table structure: CREATE TABLE 'lancamento' ( 'data' VARCHAR(10) NOT NULL, 'descricao' VARCHAR(30) NOT NULL,...
asked by 04.10.2017 / 14:44
1
answer

query executes in bank but in project points error

I have a query native: SELECT dist.nome Distrito, enti.nome Entidade, dist.id_distrito, dist.codigo_dne, dist.id_entidade, dist.id_municipio, dist.id_uf, dist.flag_ativo, muni.nome Municipio, unfe.nome UF...
asked by 05.10.2017 / 13:52
1
answer

Bring only one product per branch on the sql server [duplicate]

Good morning I need to bring only one product per branch, however in my table I have several times the same product just changing the date, I would like to get the product from the last date. What I have: SELECT ID, CODFIL, DT, COLUNAVARI...
asked by 06.06.2018 / 15:15
1
answer

Date manipulation

I wonder if it is possible, after converting the date and bringing only the time, manipulate this result to return the closed time. The example below details it best. CONVERT(VARCHAR(19), DATEADD(second, cr.open_date ,'1969-12-31 21:00:00'), 1...
asked by 27.04.2018 / 20:32
2
answers

Rename table in firebird

How to rename table in firebird 2.5 ? I'm using query : ALTER TABLE cliente RENAME TO clientes; , but the error appears:    invalid toke 'rename'.     
asked by 16.01.2017 / 15:22
3
answers

Select with last record

I need to value the inventory of the company in which I work and for this I will get the last value of the items. I was using MAX , but I realized that if I did this, it would return me the highest price and not the last one registered in...
asked by 04.01.2017 / 15:00
2
answers

Calculate Difference between 2 dates (have time in them)

Hello, I would like to do the following calculated. Initial date = September 11, 2017 at 11:35 Final Date = September 11, 2017 at 12:35 p.m. It should appear to me 01:10. Another example: Initial date = September 11, 2017 at 11:35...
asked by 11.09.2017 / 21:30
1
answer

See What is the Employee Salary on a Certain Date

Does anyone know what a query would look like for a given employee's salary on a given date? The salary readjustment history table for each employee has the following fields: MATRICULADATASALARIO_ANTERIORREAJUSTENOMEADMISSAO_DATASALARIO_F...
asked by 14.09.2017 / 20:50