Questions tagged as 'query'

1
answer

Find two matches in a field

I have a table with two fields and I want to draw the matches in another field from another table. One field is the beginning and the other the end of the same field. Table1 CampoA can end or not with _ CampoB a...
asked by 18.06.2018 / 15:26
2
answers

MultipleObjectsReturned Django

I want to return the 2 or n records matches that appear but shows me the following exception    Exception Value:       get () returned more than one File - it returned 2! The Query that returns the exception queryModeloArchivo= Archivo...
asked by 27.03.2018 / 19:46
1
answer

How to implement the max and min in jpa, to obtain the maximum and minimum date?

I have the following query @NamedQuery(name = "findRegistroAccesoByNuserid", query = "select myRegistroAcceso from RegistroAcceso myRegistroAcceso where myRegistroAcceso.nuserid = ?1 and TO_CHAR(myRegistroAcceso.fecRegistroEntrada, 'dd/MM/yyyy...
asked by 24.03.2018 / 00:43
1
answer

Go through a ResultSet of objects that have another object as an attribute

The problem is that I create objects of class Car that have as an attribute an object of class Motor, when going through the resulSet of the query I have printed the data I can not do it well. In the database there are saved 2...
asked by 04.04.2018 / 17:35
1
answer

SQL insert more than one record in a table in an INSERT

I would like to make a query where I insert a record that is related to 2 more tables. MaximosyMinimos INSERT INTO MaximosYMinimos (ProductoID, SucursalID, Max, Min) VALUES ((select p.ID from Productos as p where p.ID = 1325 ), (select s...
asked by 19.02.2018 / 21:23
2
answers

Select the Last Value

I have two entry and purchase tables, each relating to your detail: entry_interior and detail_buying , which I want to get the last cost of a product which will be delimited by the most recent date, either the entry or the purchase....
asked by 08.02.2018 / 17:41
2
answers

Mysql query from URL

Basically what I want to do is a query to MySQL with PHP and bring the results of the row specified in the URL. For example, my URL is this: link Then the query brings the results of the row that contains that nick (the nickname is unique, i...
asked by 18.01.2018 / 18:18
1
answer

Queries with My SQL

I have a SQL query that I can not solve: Structure of the tables used:    User table id pk uq ai nn nombre varchar(25) null apellido varchar(25) null    Position table id pk uq ai nn cargo varchar(50) null departamento varchar(50)...
asked by 23.12.2017 / 05:18
1
answer

mysql show the record that is current as of date

Hello friends could you help me? I have these records: +-----+------------+------------+ | id | date_start | date_end | +-----+------------+------------+ | 181 | 1511553600 | 1511899200 | | 186 | 1512158400 | 1512504000 | | 191 | 1512763200...
asked by 04.12.2017 / 23:31
1
answer

Query to add does not give me the result

I'm trying to add the amounts of a column, I have this query, but when I show it on the Web it does not show me the result. <td> <?php $query = mysqli_query ("SELECT SUM(importe_total) FROM consumobar"); $result = mysq...
asked by 30.10.2017 / 18:00