Questions tagged as 'sql'

1
answer

Select the names of employees who are not administrators

I am trying to perform a query based on the hierarchy of employees in an organization. An employee is an administrator if any other employee has their managerId set to the first employee id. An employee who is an administrator may or may not...
asked by 27.11.2017 / 16:10
1
answer

problem with DISTINCT SQL [closed]

I have this query that shows me several records with the same name, I just want the Variable Name to appear only once for the repeated records, I know that it is with DISTINCT but it does not do anything SELECT DISTINCT IDVariable...
asked by 08.05.2018 / 21:36
1
answer

Print data in a table

good I have a query which will look for the payments of people and show in a table that month paid and leave blank or print that month I do not deposit, I have the following code, but that is stuck here to show the payments in your due month, th...
asked by 09.09.2018 / 17:51
1
answer

Problems with query JOIN SQL Server

I have two tables They have Field1 and Field5 in common, so I tried the following query: Select Campo1, Campo2, Campo3, Campo4, Campo6 From Tabla1 T1 Inner join Tabla2 T2 On (T1.Campo1 = T2.Campo5) hoping to have something like t...
asked by 04.01.2019 / 23:01
1
answer

Select query that ignores certain values [closed]

I have a query where you selected all the A, B and C values from the "letters" table But I would like that when it comes to showing my results I would omit, for example, the B SELECT * FROM letras where !B How could I in a select discrimi...
asked by 24.07.2018 / 14:27
1
answer

SQL Queries related tables Oracle [closed]

I do not know how to resolve these two queries: The first query would be like this? there is no other way to put it that lasts 3 months exact, I say it by 30.31s SELECT ID_PRODUCTO FROM PRODUCTOS WHERE ID_PRODUCTO IN ( SELE...
asked by 04.03.2018 / 16:32
1
answer

In a query add data only to the first data obtained - SQL

I have a table with X number of records, but I'm interested that only the first record can be given an extra data, this can be by identifier field , that is, the smallest identifier, this only in order to identify which was the first record to...
asked by 21.05.2018 / 16:05
1
answer

SQL sum of sum totals

I would like to help me. This time with a summation of sum totals of other sums. The error tells me that:    The sum function requires 1 argument. Something about the code: select colum1 as Total, colum2 as Co,...
asked by 10.12.2018 / 14:04
1
answer

Create a query that does not duplicate data in SQL SERVER [closed]

Good afternoon I would like to know how to make a query that would come out something like this SELECT Paciente= HC.IdPaciente , Fecha_Adm = CONVERT(char(10), E.FechaAdmision, 101), Activo = CASE WHEN E.Estado = 'Activo' THEN...
asked by 30.10.2018 / 19:28
2
answers

some idea how to select a round numbers in sql server

Someone has some idea of how to select from a table round numbers. I would be grateful for an example or some idea so I can implement it in my BD THANK YOU ...     
asked by 07.11.2018 / 19:26