Questions tagged as 'order-by'

2
answers

Sort Dropdown with jquery after append [duplicate]

If the user does not find the desired item in the dropdown list, it can include a new item, for this I used the prompt function of javascript , and then the user types the name and clicking Ok , if the object is not a...
asked by 19.12.2016 / 21:41
3
answers

How to perform UPDATE with ORDER BY on sql server?

I would like to perform an update ordering the results of it, so I wanted to run an update like this: UPDATE pessoa SET nome = 'Jose' WHERE sobrenome LIKE '%Betalla%' ORDER BY nome But when I try to perform this update, an incorrect syntax...
asked by 29.02.2016 / 19:53
1
answer

Sort the latest entries according to the registration date

Sort the last ads registered in mysql, with the dates closest to the current date using PHP The field type (date) in mysql is as (date) This is my query : SELECT * FROM frame_anuncio WHERE ativo = 'Sim' ORDER BY destaque ASC LIMIT $inicio...
asked by 07.05.2014 / 14:40
1
answer

How to do sorting by two parameters with Laravel 5.4?

I am doing a descending order to list winners, however it is based on note. My search is as follows: public function getHistorico($id_avaliacao) { return $this->where('avaliacao_id', $id_avaliacao) ->orderBy('nota', 'des...
asked by 23.02.2017 / 14:30
1
answer

INNER JOIN with ORDER BY

In MYSQL I have two tables, product and product_photo. In the product_foto table there is a field that calls first , which normally has its value 0. In the site administrative system there may be a marking of which photo will be the first...
asked by 24.06.2016 / 16:32
1
answer

List the last users logged in (GROUP BY AND ORDER BY)

I have two tables ( user and log ), and would like to list the users by sorting by the last logged in. I'm using GROUP BY to join the logs (since a user can have more than one). The problem occurs when I add the ORDER BY , return...
asked by 23.04.2017 / 15:52
5
answers

Sort in the query - Leave the last record first and then sort by a field

I'm having to create a query that returns the data sorted by a specific field, for example name, but the first return line must be the last id. Can you do this with sql? Let's suppose I have the user table: id nome 1 João 2 Marce...
asked by 27.08.2014 / 21:43
1
answer

Sort list by string property with number

I have an object of type Ata where I have the property NroAta that corresponds to the number of the Minutes in question, but in the grid when I will sort by this number, it ends up putting the numbers in the wrong order. Ex.:...
asked by 09.09.2016 / 20:53
1
answer

"order by clauses" can create conflicts with each other?

Is it possible that if we have multiple clauses in order by , they are in conflict with each other? For example: select candidato.nome from candidato, perfil_oferta, prova_de_afericao where candidato.bi = prova_de_afericao.cod_prova and...
asked by 19.11.2015 / 18:15
1
answer

Sort MySQL query for the last 3 months

I want to do an ordered SQL query for the first 3 months from the current month, for example: Current month is August (08), so I order as: 10 9 8 1 12 I am using the following command: SELECT * FROM 'tb_convencao' WHERE 'lg_historico'...
asked by 25.08.2015 / 19:10