Questions tagged as 'select'

2
answers

How to make more than one select in the same query?

How can I make more than one select in the same query? I tried the following (using UNION), but it did not work: DATABASE Table: lines_cameras id_camera_linha | nome_linha_camera Table: Manufacturers id_fabricante | nome_fabri...
asked by 09.01.2017 / 13:23
2
answers

Use value of a select with JavaScript

I need to use the value of a select in an if, I currently have this: Esse seria o HTML: <p>Quantidade de vidas? </p> <select> <option value="vidas1" id="vidas">Mais 1000</option> <option value="...
asked by 11.12.2018 / 19:03
3
answers

Select to bring the amount of certain records into related tables

In the MySQL database I have these 3 tables: CONTROLS: Here I make the trainings entries made. Note that you can insert multiple collaborators on the same line EMPLOYERS: SECTORS: ThecontributorscolumnoftheCONTROLtableisaforeignkeyintheCO...
asked by 17.09.2018 / 13:18
1
answer

Where it takes a long time

I'm using Laravel 5.6 My model is normal <?php namespace App; use Illuminate\Database\Eloquent\Model; class MyTable extends Model { protected $table = 'myTable'; public $timestamps = false; } I'm trying to make a simple qu...
asked by 25.09.2018 / 22:22
1
answer

Select a list of values and from this list, select the lowest value

I want to select the last 10 inserts of a table and among those 10, return the lowest value. Is it possible to do this in a single query? Selecting the last 10 values: SELECT id_relevo FROM relevo ORDER BY id_relevo DESC LIMIT 10     
asked by 23.09.2018 / 03:30
3
answers

leave first selected item selected

Good afternoon to everyone, how are you? Next, I'm listing some courses with v-for and it's a good one, however, option needs to be selected and I'd like the first select item already selected to indicate to the client better ... it works, but it...
asked by 13.09.2018 / 19:55
2
answers

How to do MYSQL and PHP query using an array as pro condition WHERE

I am making a query in MYSQL that brings the emails that were sent. These emails are in the emails column, separated by commas, as in the emails table sent below. emailsenviados IDenvio|emails 1 |[email protected],[email protected],[email protected] 2 |[email protected]...
asked by 16.07.2018 / 21:48
3
answers

Display only one message at the end of an operation within a WHILE

I have a situation. I do a search on a table and from the data returned, I insert into a new table and update the current one. Ex: $busca = $link->prepare("SELECT valor FROM tabela1 WHERE funcionario = ? and confere = 0"); $busca->bind_...
asked by 21.09.2017 / 21:50
3
answers

Query that lists the dates

Good evening, How Query can take the following action in PostgreSQL: List the dates that fell on the Sunday of the last 6 months based on the current date, regardless of the data in the database. NOTE: The records that are in the data...
asked by 02.10.2017 / 02:38
2
answers

SQL for last month and last two months

Hello. I'd like some help here. I need to get the records: MySQL Database 1) last month 2) last 2) 3) Current year SELECT id, data, lote, modelo, qtd FROM controle_diario WHERE modelo like ? The table is very simple: id is auto-increment,...
asked by 30.05.2017 / 13:56