Questions tagged as 'select'

2
answers

how to do consultation by Month?

In the DB table I have a "day" column type "date" saving "yyyy-mm-dd", I'm trying to make a query that returns me the current month, I've tried it in several ways and nothing. <?php session_start(); date_default_timezone_set('Americ...
asked by 06.12.2018 / 22:09
0
answers

Join in 3 tables

I need my query to return who is the direct partner of the company "Father" and the company "daughter". I got him back to the daughter company and the direct partner, but I need him to get me back if the daughter company has a partner. can anybo...
asked by 02.12.2018 / 19:01
1
answer

SELECT TO REDUCE VARIOUS INPUTS SEEN IN MYSQL

Good morning, I have searched and found nothing very useful. I have an inventory database of my Network Stations. The agent installed on each station sends the names of installed programs to the softwares.name table. When I make a select...
asked by 14.11.2018 / 14:33
0
answers

Search for recipes with ingredients that you enter. How can I do this?

                                  Search for recipe with the ingredients that the user entered          In this code below, I can fetch recipes that have the ingredient that it reported. But I want the user to enter the number of ingredients he...
asked by 18.11.2018 / 18:12
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
2
answers

SQL: Make comparison between 2 columns and return only 1

I have a client table that includes PF and PJ clients. In this table, if the customer has CPF, they do not have a CNPJ, if they have a CNPJ they do not have a CPF. I need a query that checks which of the two columns is not null and returns only...
asked by 09.11.2018 / 21:52
0
answers

Parameter by name in the query

I have the following query SELECT * FROM myTable WHERE ip = 192.168.1.2 I would like to make a query by sending parameter by name using DB::raw() $dados = DB::raw("SELECT * FROM myTable WHERE ip = :ip", ["ip" => '192.168.1.2'])...
asked by 15.11.2018 / 19:01
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
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

Request returns 403, only sometimes

Good night, guys. I have a (shared) server with some tables in the database. While my main application was running, I realized that some POST requests were returning 403. To pull information from the database the application sends a post t...
asked by 16.10.2018 / 01:29