Questions tagged as 'query'

1
answer

Help with UPDATE in logic using queries

This is the following, I have two tables, the esc_usuarios table that contains information for registered users and esc_usuarios_slog , which contains the records of the lows, in which they are performed through a button that change...
asked by 09.11.2018 / 20:09
0
answers

Query in mysql grouped by hour

Good afternoon. I'm doing a query in mysql and it returns the precise values. My problem is to display values that do not return eg: I asked to group by hour or by day it only returns values that are data. Since values that do not have data a...
asked by 27.11.2018 / 15:54
1
answer

How to do a recursive query with stored relations in a JSON array?

I have a MYSQL table that relates to itself. The relationships are represented in the same table by JSON Array . Here is the table and some sample data: CREATE TABLE 'templatedata' ( 'Id' char(255) NOT NULL, 'RelatesWith' json DEFAUL...
asked by 07.11.2018 / 11:51
0
answers

Add to SQL or PHP for better performance and less weight on the server?

I am working on a voting system (5 star ratings), and I want to get the total vote amounts divided by 5 and 1 to show the percentage of each note. However I could do a select already with the sum of everything as ex: SELECT SUM(rating = '5') a...
asked by 09.11.2018 / 00:21
0
answers

Query with last records grouped by 1 field

I'm using PHP with the MongoDb DRIVER. I can use simple query using sorts , selecting a record by id, but I want to make a query that takes the last records of the collection, grouped by idHostName . In the document I have the...
asked by 08.11.2018 / 13:52
1
answer

Link in table of computers that submits a field to a file

Good morning everyone, I have a table, which is a query select of the data of the devices I control. In it I have several elements, such as Name, MacAddress and IP, for example. In the IP column, I want a link and from it (the IP o...
asked by 30.10.2018 / 12:56
1
answer

Bring range data

I would like to bring even the ones where there was not value in the query For example; table data id | valor | data 1 | 5 | 01/10/2018 2 | 6 | 03/10/2018 3 | 7 | 04/10/2018 5 | 8...
asked by 29.10.2018 / 19:42
2
answers

Sum of fields filled in within SELECT itself

I have an SQL query in the following format: SELECT XXXX AS duracao, calcula_horas_manutencao({data_inicio_f}, {data_final}, contrato.id) as horas_manutencao, calcula_horas_sistema({data_inicio_f},{data_final}, contrato.id) as horas_s...
asked by 05.11.2018 / 18:57
0
answers

Consultation in the Moodle bank in order to bring the number of students approved in a certain course

I need to create a script that searches the bank of Moodle for the number of students approved in a given course and the number of students dropping out, I ask the help of experts about the Moodle bank schema for a path in order to assemble my q...
asked by 18.10.2018 / 16:23
1
answer

How to enter a keyword in a search in the bank already done

For example, I did a search of all the user data in the bank to echo echoes in different columns through the site: $stmt = $conexao->prepare("SELECT * FROM esc_usuarios WHERE usu_codigo = ?"); $stmt->bind_param("s", $usu_codigo);...
asked by 23.10.2018 / 20:24