Questions tagged as 'sql'

1
answer

GROUP BY in query

I have a table with the following columns: nombre , monto , fecha . I want in a query to show the information grouped by name and month in the following way: nombre1, suma(monto), marzo nombre1, suma(monto), abril nombre2,...
asked by 18.04.2016 / 20:38
2
answers

Add query results with group by

I have the following query SELECT count(dp.id_dieta) * (select d.dieta from dietas d where d.idDietas = dp.id_dieta) as t FROM dietaspartes dp WHERE dp.id_parte in (SELECT p.idparte as part FROM partes p WHERE p.IDProyecto...
asked by 03.12.2018 / 15:14
1
answer

problem with rankeo on sql server

I have the following query SELECT em.id_empleado, p.des_familia, RANK() OVER(PARTITION BY p.des_familia ORDER BY sum(venta) DESC) AS RankByVentas, sum(venta) as venta, sum(unidades) as unidades FROM dim.empleado as em, fact.venta...
asked by 27.11.2018 / 14:06
1
answer

Error 233 sql server 2014

How can I solve this problem: try from server administrator     
asked by 24.10.2018 / 17:34
3
answers

$ _GET id does not work for me

I have the following code in php $sql = "SELECT * FROM categorias WHERE categoria_id='{$_GET['id']}'"; $resultado = mysqli_query($con, $sql); if (mysqli_num_rows($resultado) > 0) { while ($row = mysqli_fetch_assoc($resultado)) { //......
asked by 09.08.2016 / 14:35
2
answers

How can I avoid Duplicate Registration in MySQL?

I'm trying to make a validation to avoid that the user or users avoid double posts, that is to say that the mail data in the user table within MYSQL PHPMYADMIN does not repeat, my code is as follows <?php require_once "Conexion....
asked by 12.08.2018 / 22:41
1
answer

Error initial initial SQL Server SERVER BROWSER [closed]

after changing the name to my pc sqlServer stopped working, and when I try the sqlbrowser service initially I will not leave.     
asked by 30.06.2018 / 01:09
2
answers

Query by date range with many nested queries

I have to obtain a list with the clients of the company to which we have invoiced something during the current year, indicating how much we have invoiced each month. I have two tables: the customer table (customer) and the invoice table (invo...
asked by 12.12.2017 / 11:43
2
answers

Delete a row from my table

I want to delete a row from my table and I want to do it by means of a form in which I say the id of that row. Why do you tell me that I have not defined the value? I mean, is not it picked up like this? $valor = mysqli_real_escape_s...
asked by 14.09.2018 / 19:09
1
answer

Query per month in PostgreSQL [closed]

Good day to the community, my question is how I can make a query to a specific table based on the current month, I want to get the record of the first day until the last day of the month, no matter what day of the current month we let's find, I'...
asked by 20.08.2018 / 18:29