Questions tagged as 'query'

1
answer

How to generate report in Jasper if the WHERE condition is not met

Hello community, I commented to you the problem that I have, I am generating a report of debts of clients with the following query: SELECT COALESCE(sum(F.total),0) AS Compra, CC.saldo - sum(F.total) AS deuda, C."razon_social" AS...
asked by 26.09.2017 / 18:22
0
answers

how to create a query in eloquent to show a table with dates in laravel?

What I want to do is a table like this that is painted in excel with a query in eloquent de laravel what happens is that I already try several codes without success the only one that works is the one that I put in the post but only for the sql e...
asked by 25.05.2017 / 05:50
1
answer

Error SQL query PHP

I am trying to create a registration form but when it comes time to perform the query to add the new user to the database, I do not mark any error and yet this new user does not appear in the table. $SQL = new PDO("mysql:host=localhost;dbname=...
asked by 11.03.2017 / 20:43
3
answers

Array of native query to Java object

I have a problem when performing a native query, where the result in SQLManager is this: Query: "select p.cod_producto, p.deno_producto, array(SELECT t.cod_tanque FROM estagas.tanqu063 t where t.cod_producto = p.cod_producto) as tanks, array(S...
asked by 27.11.2017 / 12:38
2
answers

variable in mysqli_query

I have a question with mysqli_query() , How do I send variables to my query ? I have the following code But it marks me an error when executing it How can I send the parameters POST to my query ? <?php require ('...
asked by 09.03.2018 / 22:48
1
answer

Difference between count (*) and count (column-name)

When I was practicing SQL queries, I had a question with the way of doing one. I would like to know what is the difference between:    SELECT open_date, COUNT (*) FROM accounts with this other    SELECT COUNT (open_date) FROM accounts...
asked by 03.02.2018 / 15:53
2
answers

How can I join these two SQL queries?

I need to join this query SELECT CodContrato, FechaBaja, FechaFin FROM Contrato WHERE ( (FechaBaja != FechaFin) OR (FechaBaja != **SEGUNDA CONSULTA** AND (FechaBaja BETWEEN '20180101 00:00:00' AND '20181231 23:59:59') with th...
asked by 11.12.2018 / 12:38
1
answer

Minimum and maximum values in a field in SQL server

As I indicated the maximum and minimum value of an int type field in the database. I tried this code, but it does not work for me. Sexo char(1) CHECK (Sexo IN ('F','M')) //Funciona Nota_Practica int NOT NULL CHECK (Nota_Practica > 0 &...
asked by 06.07.2017 / 20:22
3
answers

SQL Error (1111): Invalid use of group function

I have a MySQL query to extract the budgets of the last year (the highest year registered in the table): select * from Presupuestos where year(fecha) = max(year(fecha)) the date column is of type DATE. When executing the query, it shows...
asked by 05.02.2018 / 09:07
1
answer

Sort by Mysql

Good day friends I have a doubt to the I do the following query As a result I get this Is there any way to bring the data in the order in which the query was made? That is first the data of Id 1, then those of 3, and finally those of...
asked by 20.12.2017 / 07:19