Questions tagged as 'sql'

1
answer

Update a table with the field of another table (DB2)

I need to update a table with the field of another table for data after April 5. I'm using this query, but it fails because the date can not be put there. MERGE INTO a USING b ON b.cruceA=a.cruceB WHEN MATCHED AND FECHA_CARGA>='2017-04-0...
asked by 29.06.2017 / 15:46
2
answers

Problem with ORDER BY: DESC

Good, I have the following problem, that I have a social network where people can post things and send messages, the thing is that by doing select of all publications and show them the order by UNIX_TIMESTAMP (data) DESC does not w...
asked by 14.06.2017 / 15:56
1
answer

Problem with procedure and workbench

I have a procedure that fills a table with data for later reference, for it uses two views, if I run from a database manager like HeidySql the procedure works correctly, but I do charge the procedure in the workbench and impact the database from...
asked by 24.06.2017 / 14:57
1
answer

Insert current date and time in table

The following table was created, I request to be able to insert the current date and time in which the process is carried out create table "informix".ventas_saldos ( f_inicial date not null , f_final date not null , c_almacen v...
asked by 15.06.2017 / 19:09
1
answer

Get date field by subquery

Dear, I am working in the construction of a stored procedure, I need to obtain a date field from a Table B depending on a particular state, by means of a subquery in a table A, I explain: Table A contains a product and table B stores the histor...
asked by 21.06.2017 / 18:17
1
answer

Sql query with filter depending on two values within separate tables

Good, I have the following problem I want to do as a filter with sql that shows only the rows that have for example in the column job_date the value 21/02/2017 and in the column job_state the value 1 this is my code, the two are inside the table...
asked by 09.08.2017 / 23:42
1
answer

I need to make a query that shows the passenger that has traveled on all the aircraft of the company

Be the following relationship schemes: • Tramo (Nro-vuelo, Desde, Hasta) • Avión_Utilizado (nro-vuelo, tipo-avión, nroavión) • Info_pasajeros (nro - vuelo, documento-identidad, nombre, fecha) This is what I have tried: SELECT Info...
asked by 19.06.2017 / 19:25
1
answer

Queries in several tables only one column, FK, PK

For the query for example of the activity in the calendar table, we can also do it in the table Participant no? to be dragging from calendar to activity and then participant     
asked by 19.06.2017 / 04:38
2
answers

CASE WHEN FOR A SELECT

I have this table that is called SI_Consecutivo What I am trying to do is that if SI_Estado = 0 and SI_Num_Conteo = 2 Ask me this question SELECT SI_Articulo = COALESCE(t.SI_Articulo, c.SI_Num_Articulo), SI_Ubic...
asked by 28.07.2017 / 19:03
1
answer

Perform a query in SQL avoiding multiplicity [closed]

I have a table Producto and a table Proveedor (are related by campoidProducto ). In this particular case I want a query that results in all the products, and for each product show a provider (a product can have several p...
asked by 13.06.2017 / 07:03