Questions tagged as 'sql'

1
answer

SUM expression expression not working

I'm trying to make a SUM in a query that performs some calculations. Here's the example: SELECT SUM ( (qtd - qtd_devolucao) * valor AS total) FROM produtos WHERE id_pedido = '47' I'm having the following error:    # 1064 - Yo...
asked by 28.07.2017 / 13:16
4
answers

How to retrieve a value from within a tag in XML?

I have a table called SPDNFE with a column DsXML that contains all contents of a Xml . Query: SELECT top 1 SPDNFE.DsXML FROM SPDNFE where SPDNFE.CdIdNFe = 'NFe32170710490181000569550040001475221002513963' Return of...
asked by 07.08.2017 / 16:42
1
answer

How to evaluate which command to use between truncate / delete

I was reading about these commands Truncate table and Delete from , where I saw this explanation    Truncate table - This command removes the watermark from the wiping table   the same for next use.       Delete from - But t...
asked by 26.09.2017 / 21:54
2
answers

How to display the total rows of a table in a label

I do not know how to pull the total rows of a table, code: public string Eventos { get; set; } SqlCommand comando = new SqlCommand("SELECT count(*) FROM Active", conn); SqlDataReader leitor = comando.ExecuteReader(); while (leitor.Read()) {...
asked by 26.09.2017 / 18:08
2
answers

Is it possible to insert by checking the fields?

My problem is: "I have a array that stores data of duas combos . In a combo I add " P " and then the value typed Ex: In the other one I add at the start "S" and it gets S11111111 .But in my database table I have separate...
asked by 26.08.2014 / 14:24
1
answer

Model-relational in firebird with C #

Developing a small C # project with Visual Studio, firebird and ibexpert. With the tables NOT RELATIONSHIP I run everything right. But I need to relate CLIENTE 1: N to BONUS E SAIDA . I am not able to develop the following re...
asked by 23.09.2014 / 05:02
1
answer

Best SQL DBMS for large databases (RAIS RAM mem)

I'm trying to write a routine to automate the import of public RAIS micro-data and to work with them on a regular computer (RAIS size & RAM) What is the best SQL software (DBMS / protocol) to use? Preferably I would like to use RSQLlite becau...
asked by 03.10.2014 / 03:18
2
answers

Inserting 1000 records into table with uniqueidentifier as primary key

I have to add, 1000 records in a given table. It contains the field Name . I have the Script, which does the bulk insertion. However, the primary key of this table is uniqueidentifier ( Guid() ) how I can do this using th...
asked by 16.02.2017 / 12:54
2
answers

Bring sql record even not having the necessary accent [duplicate]

I need to bring a record called Vidraçaria into a search, how can I bring this record by just writing Vidracaria in the search?    Or bring water by looking only agua The search works normal when the word is spelled co...
asked by 26.11.2018 / 20:37
1
answer

Query data in two tables and add one of the columns

I have two tables I need to do a SELECT in both at the same time, basically it will work like this: Note that the result returns the column nome of Tabela A and sum of column media where ids are equal. Also,...
asked by 01.07.2016 / 13:17