Questions tagged as 'select'

2
answers

Is it possible to use Inner Join in multiple columns of the same table in a Select?

There are 2 related tables in the database. Contributors : Events(hereyouentertrainingtimeperemployee): I need to know the total amount of training time for each industry. The Select below works, but only for column C1. I need to go...
asked by 08.11.2018 / 14:13
1
answer

Enable select when selecting with jQuery

I did a perfunctory search on enabling select when choosing an option on another select , but I did not find anything that applied. $(document).ready(function() { $('select#select1').select(function() { $('select#selec...
asked by 10.11.2018 / 17:25
2
answers

Select with reference in several tables

I have three tables: PRODUTOS , PEDIDO and ESTOQUE , and I want to list all the inventory going by order and by product, as I show below: products codigo tipo medida 3020 | unico | 3 3021 | unico...
asked by 27.11.2018 / 17:52
2
answers

How to make an @foreach with Table Relationship in Laravel

I'm using the Laravel freamwork where in my database I have 2 tables:  - > claimants (with the field 'id', 'claimant', 'type_id')  - > types (with the fields 'id', 'name') Both are already with the Complainant Model Relationship publi...
asked by 27.09.2018 / 02:58
1
answer

How to create rule in MYSQL to divide the value of one column by another?

I want to know the average values (value2) in a table using AVG () (or another form). I have a table in MYSQL with the columns id, total_value, valuem2 (Value per m²), and area. In some lines the value m2 is empty and in others the total v...
asked by 07.08.2018 / 19:59
1
answer

MYSQL PHP query bring results of Today and This Week

I'm setting up a CRM type, where it does the queries in MYSQL with PHP to bring the appointments I have today, this week and all others. I'd like you to bring something like this: Hoje: compromisso A compromisso B Essa semana: compromisso...
asked by 30.07.2018 / 19:42
1
answer

Select with group by double

In MySQL I have a table named contact_status : id | id_contato | detalhamento_id 1 | 1 | 2 2 | 1 | 3 3 | 2 | 4 4 | 2 | 2 5 | 2 | 1 6 | 3 | 2 7 |...
asked by 10.07.2018 / 14:58
2
answers

What's wrong with this query?

Right, I'm trying to do a select in a database via ajax using jQuery. Here are some excerpts from the code I'm using and more explanations: Ajax function function carregaRegistros(dia, mes, ano) { dia = parseInt(dia); mes = parse...
asked by 01.06.2018 / 20:39
1
answer

Select 5 thousand rows from a table

I have a table with more than 5 thousand lines, where I have a column with year, municipal_names and another with values. I can get an average with a municipality that is represented in a row, but I wanted to do it all at once. They are all Braz...
asked by 18.04.2018 / 05:13
1
answer

SQL query with OR gets slow

I have a query that does the search using: WHERE pt.product_name LIKE '%termo da busca%' Then I want the search to also look for the artist name and put: WHERE pt.product_name LIKE '%termo da busca%' OR ct.mf_name LIKE '%termo da busca%'...
asked by 24.04.2018 / 17:22