Questions tagged as 'sql'

2
answers

Query on sql server?

I have a following query SELECT A.IdDepartment, A.IdParent, A.Localidad, A.Codigo, A.Nombre, A.Departamento, A.Fecha FROM VW_HORARIOS A INNER JOIN VW_DAY_WORK B ON A.Codigo = B.Codigo AND A.Fecha = B.Fecha GROUP BY...
asked by 24.01.2018 / 23:03
1
answer

How to go through a regristro of a query, and pass the values that are obtained as a parameter to another Store Procedure in Mysql?

I have the following Store Procedure: DELIMITER $$ USE 'open_bd'$$ DROP PROCEDURE IF EXISTS 'LlamarEjemplo'$$ CREATE DEFINER='root'@'localhost' PROCEDURE 'LlamarLibroCompras_ListarMesPeriodo'(IN rutempresaC V...
asked by 21.11.2016 / 22:35
2
answers

How can I optimize an sql query!

Hello good afternoon friends, I hope and are well, I was asked at work to work on this query: SELECT CAST(cd_ITVALCNV AS VARCHAR(6)) AS cd_ITVALCNV, cd_ICTTO, CAST(cd_IEMISORA AS VARCHAR(8)) AS cd_IEMISORA, CAST(cd_ISERIE AS VARCHAR(...
asked by 06.03.2018 / 22:40
4
answers

SQL, Problem GROUP BY

I have the following problem when ordering some records: As you can see in the image, I'm trying to filter some sales and I get duplicate fields: for example the covers ... It should be sorted by NomFam "Family name". Changing the...
asked by 18.05.2018 / 15:32
1
answer

Referencing two attributes of a table to a primary key of another table

How are you doing? You see, I'm making a logbook for private pilots. Among all the resulting entities (tables), I have two: flight and airport. This Airport table, consists of: ID, ICAO Code, Name and the FK of the city. Among the fields o...
asked by 21.09.2017 / 20:53
3
answers

Subtract 3 days from sql dates with c # [duplicate]

public List<DateTime> fechas3() { List<DateTime> list = new List<DateTime>(); List<DateTime> fec = new List<DateTime>(); SqlConnection cone = new SqlConnection(connect); cone...
asked by 07.12.2016 / 19:32
2
answers

Problem inserting null value in Timestamp on Update CURRENT_TIMESTAMP SQL

When I created the table tb_usuario, I put a field to get the exact date and time when making a record to the table tb_usuario, but when I do an insert, do not take or show the date and time when insert something. this is the code I use...
asked by 27.08.2018 / 18:19
2
answers

count two fields of a table in php sql

I have a table called matriculas_2018 and two fields one of courses and the other of specialty . I want to put an accountant that tells me how many students of the THIRD-AVERAGE course correspond to the ADMINISTRATION specialty and a...
asked by 14.12.2017 / 16:09
1
answer

Delete a record having related tables

I need to delete the idcliente , nombre and apellido of the table cliente , but it will not let me delete it because it is related to the ubicacion table. For that, I also want to eliminate all records of that cl...
asked by 01.12.2017 / 14:36
2
answers

how to make this query in sql server 2012

Hi, I need to do this query in sql but I do not know how to do it. I wanted to know if you could help me. the query would be "Show the average of disapproved in each instance." which instance in my case would be the type table: and here I...
asked by 30.06.2017 / 02:01