Questions tagged as 'sql'

1
answer

C # Executing a DDL command

I'm trying to run the DDL command below that creates the table I need, but even not returning error the table is not created, would anyone have any idea where I'm going wrong? public const string scriptCriacao = " if exists(select * from sys....
asked by 10.01.2017 / 20:02
2
answers

Show SQLITE data between dates - Android Studio (I think be between)

Well, I want you to choose the data to display between the dates he chooses. I tried everything but I still could not. In other words, I want to filter between dates, but the user has to choose them. I already managed with an SQL command, but...
asked by 03.01.2017 / 18:15
1
answer

SQL UPDATE SUM VALUE NOT NULL

dataTmp referencia nStock 2017-02-18 DC01234567 NULL 2017-02-18 DC01234567 NULL 2017-02-18 DC01234567 NULL 2017-02-19 DC01234567 0 2017-02-19 DC01234567 0 2017-02-19 DC01234567 0 2017-02-20 DC01234567 0 201...
asked by 18.02.2017 / 23:47
1
answer

Grouping of lines Group By

I have the following query: SELECT distinct CAPA.COD_HOLDING, CAPA.COD_MATRIZ, CAPA.COD_FILIAL, CAPA.ID_NF_ENTRADA, CAPA.NUM_NF, CAPA.DT_ENTRADA, CAPA.DT_EMISSAO, CAPA.COD_CLIFOR, CAPA.COD_UF, CAPA.CGC_CPF,...
asked by 04.01.2017 / 18:48
0
answers

SQL DATA EXECUTION - ODBC

I'm doubtful in the date format that ODBC runs. I tried every way and nothing. This Query performs normal if I enter only the code, but when I want to insert dates it does not execute. I believe it's because of the format. Can someone help me?...
asked by 05.01.2017 / 16:49
1
answer

Delete records dynamically in SQL

I need to delete multiple table data in different SGDB types, but I do not know how to do this in a practical way. I need to keep 10 records in the tables and I need to delete all the remaining ones, but I can not do this with the command:...
asked by 11.01.2017 / 20:26
1
answer

Doubt with date and time in sql server

I have a field in the bank of type "char", I am returning the dates this way: select CONVERT(VARCHAR(20),HORA_FECHAMENTO) as HORA_FECHAMENTO, CONVERT(VARCHAR(20), DATEADD(hour, +0, getdate()), 120) as HORA_ATUAL from TB_ESTRACAO wh...
asked by 28.01.2017 / 04:14
3
answers

SQL script to create mascara

I have a database of a client that has some unmasked data for use on my system which is the NCM ; The same has 8 digits (eg 0000.00.00), but the same in my system is unmasked "00000000" I need to simply put the points 4.2,2 but I am not...
asked by 28.12.2016 / 18:06
4
answers

How to write a store procedure that uses values from the current and previous row?

I have the following table, # id # dataTmp # referencia #nProduz#nStock # id2 #necessi# # 115237 # 31-01-2017 # VL03280103 # 0 # 0 # 6 # 0 # # 115238 # 01-02-2017 # VL03280103 #...
asked by 30.01.2017 / 15:26
0
answers

Query with arrays not working PHP SQL

To edit a report, I need to get everything and turn it into an Array. I can not use UPDATE because the user can add more rows, having to add. In this way, I thought of first to delete the data that codeReport = '$ codeReport' and then give...
asked by 26.12.2016 / 16:15