Questions tagged as 'consulta-sql'

1
answer

Get the number of rows of an SQL query

I have a problem in a query, in this query I have the students enrolled in a section of a specific year and their averages. My goal is how I can get the number of students who pulled at least one course in that year. select N.Descripcion as Ni...
asked by 18.10.2018 / 01:22
1
answer

SQL Group SUM by idemployed

good and tried in different ways to try to group a sum of 3 tables I will write the example to be clearer SELECT v.fecha_ven, e.apellidopaterno_emp, e.nombre_emp, SUM(d.precio_dv * d.cantidad_dv) AS Total FROM detalle...
asked by 20.12.2018 / 22:34
1
answer

How to make a sum of the result of a query?

I hope you can support me, I need to make the sum of the result of the wages that I throw the previous query. The result I need would only be $ 17,500     
asked by 29.11.2018 / 08:59
2
answers

Laravel nested queries, how to query three tables

I have three related tables like this: Table One related from one to many with Table2, Table2 related from one to many with TableTres. How can I make a data query from Table Three with a condition to Table1. I'm really new at Laravel and I do...
asked by 09.10.2018 / 08:40
1
answer

Duplicate records in SQL query

Holas I have the following query in SQL Server: SELECT P.ProyId, P.ProyCodigoSNIP, P.Proyecto, E.EtapaAbr FROM PROYECTO AS P, PROYECTO_ETAPA AS PE, ETAPAS AS E WHERE P.ProyId=PE.ProyId AND PE.ProyEtapa=E.EtapaId As you can see, I consult 3...
asked by 27.06.2018 / 07:22
3
answers

Help with SQL query (several records in the same field)

I hope to explain myself well and that you can help me, thanks in advance, the situation is as follows: I am developing a system that diagnoses computer failures, which will work in the following way, the user will select several symptoms and...
asked by 06.11.2018 / 11:42
1
answer

Query table in two columns but one in mysql

I have a table that has inside its columns: period (2017-10, 2017-11, etc.) amount_box (values) billed (has "yes" and "no"). I need to make a table with 4 columns: THE period, the unbilled amount per period, the amount billed per period, and the...
asked by 13.07.2018 / 22:20
0
answers

MYSQL compare all the rows of a table by itself

Description of the BSD. Sucursales +-----+-----+-----+- | idSuc | Direccion| ==================== Peliculas +-----+-----+-------+ | idPeli| NombrePeli| ===================== Inventario +-----+-----+-------+ | idPeli| idSuc | ========...
asked by 20.11.2018 / 01:34
0
answers

TransactionRequiredException exception when executing an update: javax.persistence.TransactionRequiredException: Executing an update / delete query

I am trying to execute an update query to a database with hibernate but it turns out that it shows me the following transaction exception and does not update me. I'm working with jboss, hibernate. I've tried to follow up with transaction, begin,...
asked by 02.11.2018 / 21:28
2
answers

How to make a query in sql to get a field by entering several parameters in the where

I'm doing a sql database on foods. The tables I have are meals from the sierra jungle coast and ingredients. And its intermediate tables. What I want to do is a query that allows me to obtain a meal by entering several ingredients in the where....
asked by 28.10.2018 / 02:28