Questions tagged as 'sql'

1
answer

Mult Mapping Dapper [duplicate]

I'm having problems with dapper's Mult Mapping, when I try to execute the following query it is not mapping the ids of the objects, the select is this: var sql = @" SELECT ofi.id_oficina, ofi.codigo,...
asked by 27.01.2017 / 13:10
2
answers

Import CSV and convert date in dd / mm / yyyy format to yyyy-mm-dd

I'm totally new to programming, both in Python and Sql, so I have some questions that may seem basic. I get a .CSV file that comes with lots of information not compatible with Sql so I always have to manually change and import using the followin...
asked by 19.05.2017 / 17:38
1
answer

Insert Sql Server

I have a multi-column table. The unique identifier is the ID, but my question is as follows: I have a version column , in it I want to be inserted only one value without repetition. How can I implement this?     
asked by 17.05.2017 / 17:02
1
answer

Is it possible to list the columns used in a SELECT in mysqli PHP?

I have the query SELECT coluna1, coluna2... FROM tabela I wonder if there is any method in the mysqli class to return those columns that were used in the query, even though query does not return records. In a% return% of reco...
asked by 19.12.2016 / 13:03
1
answer

Doubt in converting rows into columns Sql Server 2012

I've transformed rows into columns and need to improve this query by adding another column row: This is a query: --****************************EMPRESA****************************** if(Object_id('tempdb..#TBEmpresa') is not null) dr...
asked by 24.06.2017 / 20:18
1
answer

Return only part of the SQL field in the search

I wanted to return only the values that are in brackets in the table field in the query. SELECT F2 FROM [dbo].[Vestcasa_Ranking_Produtos_Custo_] F2 Airtom..(635) paulo victo r.. (234) Antonio.. (459) SEARCH THIS 635 234 459     
asked by 06.10.2017 / 20:23
2
answers

Rows in Columns (SQL)

I've been thinking of a few days ago to make a select less verbose, turning rows into columns. Today I have it this way: (SELECT s.code_sample FROM app_sample s WHERE s.id_analysis = a.id AND s.sequential_order =...
asked by 01.06.2017 / 18:55
2
answers

Join bringing wrong value

I have two tables Company: id_empresa id_usuario vl_honorario dt_honorario id_honorario 86 1 200 2017-01-04 7 86 1 600 2016-12-01 6 86...
asked by 02.12.2016 / 12:12
1
answer

Truncate tables with cascade

I have a table hotel and table reservation. In the reservation table I have the primary key of the hotel table as the foreign key. I can not truncate because there are relationships between braces. How can I do it? I already did: trun...
asked by 26.11.2016 / 20:01
1
answer

SQL Query - Non Duplicate Results

I want to return a search of the database without repeated data. The table is named Wps_history and contains the following columns: id user_id adm_user_id type user lancamento data valor saldo reason ip inserted I'm doing the sear...
asked by 08.12.2016 / 16:36