Questions tagged as 'distinct'

1
answer

Select Union same table

Could anyone help me with this problem? The following query throws the following error:    # 1054 - Unknown column 'u.idocorrence' in 'where clause' SELECT DISTINCT * FROM( (SELECT o.*, u.nome AS requerente FROM ocorrencia o, util...
asked by 28.02.2016 / 00:34
2
answers

Select Distinct is bringing duplicate data Mysql

Hello, I'm having problems with a query, and I need to bring only the last record of each id_face that has in the imagens table, but for some reason it's causing id_faces duplicates Follow my query: SELECT DISTINCT(...
asked by 04.12.2018 / 12:45
2
answers

Selection top 3 where distinct

Good afternoon guys. link I need a help, I tried to see in the session above but I could not solve my problem. My problem is as follows, I need to make a selection of products and all of them separated by vendor, for example. Imagi...
asked by 02.10.2018 / 22:21
1
answer

Consolidate all columns in only one row MYSQL

I'm trying to make a query that aggregates all the results in a single line, ie, does not bring duplicate results. I've already used distinct and group by but none of the two returned me what I need. My query is as follows:...
asked by 18.07.2018 / 01:27
1
answer

Mysql - Order before grouping

I need to make a selection that will bring the last users who logged in without repeating the names. The problem is that the command below first groups and then sorts: SELECT usuario FROM tab_logins GROUP BY usuario ORDER BY data_login desc...
asked by 11.03.2018 / 17:47