I have a table that has all the address in a single column, but it is irregular. Here are some of the following:
BR 459 KM 153
RODOVIA ITAJUBA MF KM 05
Rodovia MG353 2Km 55
RUA 37 QUADRA 4 LOJA 611 E 1621
Rua 13 de Maio 71C
RUA 106 Nº07
RUA...
I need to do a select with JOIN on two tables but I can not group to not repeat the rows. Here is the SQL expression:
SELECT
Andamento.NumeroProcesso,
Andamento.Chave,
Andamento.Codigo,
Andamento.DataAnda...
I have the following table
ID | Início | Fim | Horas
333 | 01/01/2017 | 03/01/2017 | 5
333 | 02/01/2017 | 05/01/2017 | 1
333 | 05/01/2017 | 07/01/2017 | 3
333 | 01/01/2017 | 07/01/2017 | 6
I need a result like this...
I have the following table structure
The goal is to get the last 3 oldest records (oldest date) sorted by Name. I'm currently using subselect:
Select * from
(Select top 3 from TB
order by Data desc) A
order by Nome
Are there an...
Is it possible to query all tables with the same column for their values?
For example, I have the Bank named SGE , I have 230 tables in it, all these tables have the CodPRF column and I want Query to return all the results in th...
I need to change a field in the SQL database table whose format is in nvarchar(50) and saved values in date format 07/09/2017 , containing NULL values too! Do I need to convert this direct field in the database to datetime...
I have the following function that calculates the 01:00 hours, returns 60 minutes.
but the sql column stores in time (0) 01:00:00 format,
What about the error in my function, I do not know how to increment the code to calcu...
I need to make multiple inserts that will depend on an existing result in a table like this:
--CRIA TABELA #CONTATO
CREATE TABLE #CONTATO(
NOME VARCHAR(100) NULL,
TELEFONE VARCHAR(50) NULL
);
--INSERE 2 LINHAS NELA
INSERT INTO #CONTATO...
I have a temporary table that I fill in with the result of a given query. Now I need to go through the data of this temporary table, line by line, and pick certain fields and insert them into another table, and in that other table, generate a co...
By using SELECT to get the data of tabela_A by joining with tabela_B , normally, and assuming it to be the correct form, we use some of the JOIN commands. Ex:
SELECT codigo, nome FROM tabela_A a
INNER JOIN tabela_B b...