Questions tagged as 'select'

3
answers

RETURN THE SUM OF MAXIMUM 3 VALUES IN SQL

I have a table and need to return the following: check based on the recipient column, add up the 3 largest amounts of that recipient, bring in the query only if the sum of the 3 largest are > = 1024: CREATE TABLE TRANSFERS( SENDER VARCHAR2(...
asked by 12.06.2018 / 19:56
2
answers

optimized form retrieve last mysql ID

What better way to retrieve the last id from the table? I tested these two methods and the orde by took longer, is there any more of these? Note: this will not be a query after insert. It will be a separate query. select max(campo_id) fr...
asked by 09.05.2016 / 02:22
4
answers

Select with redirect

I do not know how to program! but I can make small changes. I need to create a select and when the person chooses the item, it will be redirected <select> <option value="Vilhena">Vilhena</option> <opti...
asked by 24.07.2015 / 19:16
2
answers

Sort by the number of repetitions of a column?

In a query in MySql I need to select the results and sort the results based on how much they are repeated using the id_livro column, for example: My comments table: +----------------+-------------+ | id_livro | comentario | +-...
asked by 02.02.2017 / 18:35
3
answers

Select Where IN all records

Sirs, I've been looking for days to answer this question, which I think is silly, but I could not. I created a view that brings registration | Name | Title | Turn | About Us | CodTreina | Status I made this select: SELECT * FROM vw_tr...
asked by 08.05.2017 / 20:28
1
answer

Select the first row of each group in MySQL

Suppose I have a table like this: item | group -------+-------- item a | group x item b | group y item c | group y item d | group x item e | group z And I want to select a single item to represent each group. Now, you should be thinkin...
asked by 27.08.2018 / 04:03
1
answer

How to join 2 SQL queries into a single one (one is an average value calculation and another search criteria with BETWEEN

I am setting up a system that finds providers in a specific region, calculates the average amount charged by them and brings this value. But before that he will only pick up the providers that are available on the requested date. I have these...
asked by 03.08.2017 / 15:32
2
answers

How to send two values per parameter with a single selected option? PHP

I need to send two values per parameter to another page, but the value field of the select tag only sends a ... How could I send two? Follow the code: <option value="<?php echo $data->format("d/m/Y"); ?>"> <?php ech...
asked by 01.12.2014 / 23:17
2
answers

How to modify the value of the fields of a column?

I have a simple question but I could not find a solution. In the same way I can when I use select to bring an empty column using select a.x,NULL as y,a.z from DADOS a , how can I make a column instead of having only NULL ,...
asked by 12.08.2016 / 01:47
1
answer

Problem when using Select

I'm trying to use form select of this site here: link But when I put on my site the only thing that appears is this:    "Materialize Multiple Select" Does anyone know how to solve this? The code is this: <div c...
asked by 19.01.2016 / 13:29