Questions tagged as 'sql'

1
answer

Sum Sql Server with condition

I have the following query: select distinct GETDATE() as Fecha_Actual, f353_fecha_vcto, DATEDIFF(day, f353_fecha_vcto, GETDATE()) AS Dias_Vencidos, f353_consec_docto_cruce, f353_total_db, f353_total_cr, f353_total_db - f353_total_cr AS Valo...
asked by 04.09.2018 / 18:29
3
answers

Using Contains in SQL server

Hello friends I want to make an insert, but I will only do it if one of the parameters that my SP is receiving, in this case the extension has the word "pdf" , then I'm trying to do this, but send me error: s Insert into ArchivosCont...
asked by 03.09.2018 / 23:03
1
answer

Problems counting in a Query

The structure of the tables is as follows: child CREATE TABLE CHILD( child_id SMALLINT, child_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, gender VARCHAR(255) NOT NULL, address VARCHAR(255), city VARCHAR(255), CONSTRAINT PK_CHILD...
asked by 31.10.2017 / 09:42
1
answer

sql oracle query to subtract two fields

Good, I've put the original querys that I'm going to use to give you an idea of the real problem, I need to subtract the values that return these two queries and do it all in the same query, that is, in the same query retrieve both values and th...
asked by 18.11.2016 / 19:23
1
answer

Error config file mssql

I'm trying to connect to my local database and these are the parameters I have: var config = { user: 'Eduard-PC\EdwarD', password: '', server: 'EDUARD-PC\SQLEXPRESS', database: 'nodejslogin' }; I get the following error:...
asked by 06.06.2017 / 02:47
1
answer

Create a query using a single table, in SQLServer

List the names of the employees and the name of their respective boss (only those who have a boss). [use joins] SELECT * TABLE employee What I want is, if supervisor is 3 then the name of Karolina appears, which is the...
asked by 04.11.2016 / 08:46
2
answers

SQL database error

That's the mistake he gives me.    Can not add or update a child row: a foreign key constraint fails ( osmarentcars . itv , CONSTRAINT FK_ITV FOREIGN KEY ( BASTIDOR ) REFERENCES vehiculos_alquiler ( BASTIDOR...
asked by 09.12.2016 / 12:57
1
answer

Store subquery in a variable (PHP)

Can I store the result of a query in a variable and use the value in another query? //consulta que quiero hacer primero $consulta_pre_has = "SELECT MAX(Prod_Pres) FROM productos"; //hago la consu...
asked by 23.03.2017 / 13:01
4
answers

Join two SQL queries [duplicated]

I have two tables and two queries for each table A query is SELECT DISTINCT CodContrato, FechaBaja, FechaFin FROM Contrato WHERE (FechaBaja != FechaFin) AND (FechaBaja BETWEEN '20180101 00:00:00' AND '20181231 23:59:59') and the other...
asked by 12.12.2018 / 10:16
2
answers

Replace the value of NULL with a fixed value in a Join SQL Server

I'm joining two tables in SQL using a LEFT OUTER JOIN. This is my query: SELECT V_InvoiceHeader.IDFactura, V_InvoiceHeader.FechaDocumento, V_InvoiceHeader.NombreCliente, V_InvoiceHeader.NIT, V_InvoiceHeader.DireccionFacturacion, V_In...
asked by 30.11.2018 / 18:36