I have the following function that treats a time that comes from the bank:
SELECT f.chapa AS chapa,
f.nome AS nome,
f.secao AS cod_secao,
f.nsecao AS desc_secao,
c.codigo AS cod_funcao,
c.nome AS desc_funcao,...
Considering a variable with a text in SQL Server . How can I remove 2 or more spaces within the text? In this case leaving only 1 space.
For example:
'1 tigre, 2 tigres, 3 tigres'
Should result in:
'1 tigre, 2 tigres, 3 tigres...
We can use the NOLOCK feature in SELECT , thus avoiding locks with INSERT
SELECT COUNT(Descricao) FROM Produtos WITH (NOLOCK)
Would there be any way to use WITH(NOLOCK) in the Entity Framework?
I'm developing a game, and in it I need to do a ranking according to the time it took the user to reach the end of the game.
My question is, what kind of data should I use in my database to be able to organize when displaying the ranking?...
I have a field in a table that must be filled in all lowercase, but the user being user has filled some lines in uppercase. I want to identify which records are in order to request correction.
How can I test if my string is all uppercase?
...
I would like to know how to write a SQL for control purposes of the statement being sent to the database:
$sql = $pdo->query("SELECT * FROM imovel WEHRE CATEGORIA = 'APARTAMENTO'");
How to print the SQL statement being sent to the bank?...
DBMS: MySQL
Problem: How do I return the subtract of the current date with a specific date and return the value in YEARS, MONTHS and DAYS in a query?
Example:
DADOS
DataAdmissao dataAtual
2010-04-07 2014-06-27 (este dado não está...
I have the following structure:
link
CREATE TABLE Viagem (
Idasemvolta int,
Idacomvolta int
);
INSERT INTO Viagem
VALUES (64, 39)
With the following select:
select Idasemvolta, Idacomvolta from viagem
This is not the complete st...
When we model a database, can the number of columns interfere with performance?
Ex: Tabela1 possui 2 campos, 1 int pk e 1 nvarchar(50)
Tabela2 possui 50 campos, 1 int pk e 49 nvarchar(50)
Select used for both tables, regardless o...