Questions tagged as 'sql'

2
answers

Problems with max use after count

Dear, I have this query SELECT p.id_pregunta, tr.tipo, COUNT(r.id_respuesta) as cantidad_respuestas FROM encuesta e LEFT JOIN dimension d on e.id_encuesta = d.id_encuesta_p LEFT JOIN preguntas p on d.id_dim...
asked by 29.12.2017 / 07:10
2
answers

How to truncate a date with time in postgresql?

Execute: SELECT NOW() and it appears to me: '2017-08-07 10:53:44.207-06' And I want to appear '2017-08-07'     
asked by 07.08.2017 / 18:55
2
answers

Candidates whose average is below the general average

I want to complete this SQL statement, so that I only return the candidates whose average is lower than the general average: SELECT Candidato, COUNT(Candidato) AS num_votos FROM votos GROUP BY Candidato The structure of the table is: CREA...
asked by 03.07.2017 / 07:53
2
answers

error in MYSQL query

I'm doing a query which returns empty values when that column has data with those values, this is the query. select * from 'clase' where 'fk_id_familia' = 3 and 'fk_id_familia' = 6 and 'fk_id_familia' = 2 And these are the data that the...
asked by 27.10.2017 / 18:23
1
answer

How to consult data from parent tables using foreign keys. oracle

I have a Staff table with the following structure: create table PERSONAL ( personal_id NUMBER(8) not null, nombre VARCHAR2(50), apellido VARCHAR2(50), ) alter table PERSONAL add constraint PK_ID primary key (PERSONAL_ID); An...
asked by 03.02.2017 / 11:55
4
answers

How to connect phonegap / Apache Cordova to SQL Server?

I have just started in the world of hybrid applications, with Apache Cordova the detail is that it is only HTML, CSS and JS; the problem is that I do not know how to connect direct JavaScript with SQL. Does anyone know how to do it, or any al...
asked by 28.12.2016 / 05:16
1
answer

Error while doing an SQL query

I have a small problem with a query, I am trying to add the amounts that exist in my table detalle_ventas, what I want to do is add the quantities that have the same product_id and the same expiration date. Example: id_producto | fecha_venc...
asked by 10.04.2017 / 14:52
4
answers

SQL - query of minutes elapsed

I have the following query: SELECT BELNR_ID ,BELPOS_ID ,DocDate ,AUFTRAG ,APLATZ_ID ,CONVERT(VARCHAR(10), ANFZEIT, 103) AS 'Fecha Inicio' ,RIGHT(ANFZEIT, 7) AS 'Hora Inicio' ,CONVERT(VARCHAR(10), ENDZEIT, 103) AS 'F...
asked by 19.04.2017 / 16:27
2
answers

Query database by parts

I'm looking for a way to make my database show up in parts. That is, first the first 10 rows, by pressing a button, make a query with the other 10, and so on until the end. I have searched the internet and I have only found the LIMIT claus, whic...
asked by 12.09.2016 / 01:08
1
answer

Select values from the XML field in SQL Server 2008

I have a table in SQL that has two fields ( id , xml ), just looking at my XML field, the row is like this: <Sheet1> <Production_x0020_Line>L1B4</Production_x0020_Line> <Item_x0020_Number>VPJG7F-1084...
asked by 06.04.2017 / 16:44