I have the following query:
with
Consulta as (
SELECT
V.CHAPA,
F.NOME,
V.DATA,
F.FILIAL,
DATENAME(dw,V.DATA) AS DIA,
MAX(V.SEQUENCIALBATIDA) AS BATIDA
FROM
V_BATIDASANTIGAS AS V
LEF...
I have the following query:
SELECT
DATEDIFF(hh, MIN(BATIDA), MAX(BATIDA))AS HORAS
FROM ARELBATIDATRANSITOVIEW
WHERE CHAPA = 3187
AND BATIDA IS NOT NULL
AND SEQUENCIALBATIDA IN (2,3)
GROUP BY DATA
ORDER BY DATA DESC
Example:...
I tried to delete a column from a database, I noticed that there are restrictions.
ALTER TABLE dbo.TB_ESTRACAO DROP COLUMN MULTIPLIER
I get a message, how can I resolve this? Thanks!
Message 5074, Level 16, State 1, Line 1
The obje...
I'm doing select below and I can not execute:
SELECT DISTINCT U2.NM_ORG AS [Orgão Subordinado],
U1.NM_ORG AS [Unidade Gestora],
E.NM_EPG AS [Nome Funcionário(a)],
C.NM_CG AS [Cargo Funcionário(a)],
D.CD_DOC_...
I can not import a backup (.bak) into the sql generated on another server, it says that the database is not the same as the one I'm trying to import and tals, and I put the same name.
Does anyone know what might be happening?
I have 2 tables in which one is inserted the records that come from a file txt and the other the records that come from a file excel .
With this, I need to delete the records of the txt table that contain the excel...
I need to return the total records of the query in a column, repeated same, type this:
However, the query is a bit annoying. A query of 106 rows, with multiple SUM () and with a mandatory ORDER BY. I can not use GROUP BY in this query beca...
Good evening guys I'm doing a system for college and I'm trying to do with the procedure but it's not recording in the bank I think there's something wrong but I do not think so. I tried to use CM.Parameters.AddWithValue and CM.Parameters .Add m...
I have a SELECT with several LEFT JOIN , however I need to consider all these LEFT JOIN in some conditions, already in another condition I need disregard a made JOIN .
As an example:
SELECT *
FROM
TabelaTot...
I installed SSM 2016 (Sql Server Management Studio) for days on my PC but I can not create a local database.
The only thing I do is connect to a database that I hosted in azure, but when I go to create a local DB it gives error with the follo...