Questions tagged as 'query'

1
answer

I need help with a query

I would like to know if anyone knows how to make the values of an example column add up: id | Fecha | Efectivo | TC | TD | Otro | Total | Obtenido | Resta | Acomulado 1 | 18/07/2016 | 5861 | 0 | 0 | 0 | 5861 | 650 | 5211...
asked by 18.05.2017 / 18:21
1
answer

filter query with repeated values only show 1

Good morning I have this query $eventos_history_query = tep_db_query("select * from " . TABLE_HISTORIAL . " where numero_evento = '" . $customers['numero_evento'] . "' order by eventos"); while ($eventos_history = tep_db_fetch_array($ev...
asked by 04.10.2018 / 11:48
2
answers

Part of the URL disappears with a Query Vars in WordPress

On my site I am looking for a search-type URL and listing contents of a CPT, but part of the URL in the browser disappears, example: If I access the browser link in the same browser, check the content but disable ? s = wordpress of the URL...
asked by 19.08.2017 / 20:28
1
answer

Improve the results of a select with LIKE

If I make a query of the type: SELECT nombre FROM tabla WHERE nombre LIKE '%foo%' How could you sort / filter the result so that, for example, the results that most match " foo " are displayed first? For example, if you had: " f...
asked by 23.08.2017 / 00:14
1
answer

render related data

I'm using a query to search for records, I have two tables, one is "sale" and the other is "detallevet" (this refers to the details of the sale) by this query I proceed to do the search of the sales in its corresponding model: def self.busqu...
asked by 28.12.2016 / 16:25
2
answers

Slow query PHP MySQL

I have a problem of slowness when making a query to the bd, it is from a friend's website and I do not have much idea of php but the section that makes the query is the following code. function get($id_usuario=false){ global $wpdb;...
asked by 05.06.2017 / 19:14
2
answers

delete repeated values sql server

I have a problem in a sql server query ... I have this table where I need to delete repeated values (those marked in blue) due to the last column ('hh''mm') and try the DISTINCT but even so he shows them to me I do not know if I made my...
asked by 26.10.2018 / 20:46
5
answers

problem with LEFT JOIN

With this function I show a list of exercises belonging to a course that come from a table called "lessons" with the following important columns: lessons.id, lessons.number, lessons.course_id entre otras. all users see the same user_id is...
asked by 13.08.2018 / 21:31
1
answer

Insert and Search in Datetime field

I'm trying to insert a date with milliseconds, but I can not do it. The bash date has the following format: "%d%m%Y%H%M%S%2N" While in BBDD I see the following: MariaDB [db]> INSERT INTO access_wifi(DATA) VALUES ('0511201813450367'); Q...
asked by 05.11.2018 / 15:47
1
answer

Bring related data from a table

I have 2 tables a types and the other plates which are the following: But I want to bring the type of that plate, how would I do it? example: I have a plate with id 1 and it has the id_type 2 , and I want t...
asked by 30.09.2018 / 20:03