Questions tagged as 'sql'

3
answers

What is the best way to create PHP Related Posts?

I have a system that I use, but I wanted to have a system to make the search for related posts more filtered, I currently use REGEXP SQL to do, I already used LIKE and the results did not please me, Anyone have any new ideas on...
asked by 07.03.2014 / 18:03
1
answer

How to use LEAD and LAG using a condition

My question is, if I can use LAG and LEAD, using a condition in the query, for example: I have the zip column .. I want to get the value of the next line, and the value of the previous line in that same column. I'm working with C # and SQL...
asked by 29.04.2014 / 18:38
2
answers

How to use sum with condition related to another field

I have a table of ratings in the format TABLE AVALIACAO (id_avaliacao, id_pessoa, concluida, segunda_avaliacao) and another table that records the notes TABLE NOTA (id_nota, id_avaliacao, id_questao, nota) Quite abstractly, what happen...
asked by 09.09.2014 / 03:58
1
answer

Backup Database SQLServer

I know that to perform a backup in SQL Server just use: BACKUP DATABASE nome_database TO DISK = 'endereco\nome__arquivo.bak' But does anyone know how I back up all Databases together? Each in a .bak ?     
asked by 10.11.2014 / 21:24
1
answer

Is there a command to change a user-created type in Sql Server?

I created a type in my Sql Server database: CREATE TYPE [dtNumero] FROM [numeric](18, 5) NOT NULL Is there a command for you to change this type, for example precision?     
asked by 14.11.2014 / 12:17
2
answers

SELECT column type DATE by HH24: mm: ss

Hello, I have 2 DATE fields, depending on the snippet below: ...hr_inicio DATE NOT NULL, hr_fim DATE NOT NULL, ... And I need to query these fields using only the values for the HH2...
asked by 11.12.2018 / 19:11
1
answer

How to use order by stop ordering the names of the months in Oracle

Hello, I'd like to know how to solve this problem. I would take the name of the days of the month and order them and not the numbers of the corresponding months. It follows the query that I performed but that only orders in numbers corresponding...
asked by 05.12.2018 / 20:44
1
answer

MySQL query problems [closed]

<form method="POST" class="w-100" action="pesquisa_diaria.php"> <div class="card-body"> <div class="row"> <div class="col-sm-3"> <label>Tipo de Venda...
asked by 13.12.2018 / 00:49
3
answers

GROUP BY last record by month and year how to do?

I'm doing a query in the database, follow my table below id | valor | mes | ano | 1 39.69 3 2017 1 7.69 3 2018 3 9.69 4 2015 3 3.69 2 2016 2 5.89 3 2017 2...
asked by 18.12.2018 / 19:07
1
answer

Query to update field from one table based on another

Good morning, I need to update the values of one table based on the values that are in another. I need the first table to update only the data contained in the second, for example, in the first table I have 3,000 items and in the second 330,...
asked by 04.01.2019 / 12:29