Hello. There is a kubki table, it has a seria field, you need to select all the unique values ​​of the rows in the seria field, and at the same time select all the other columns.

That is, as

select DISTINCT(seria) from kubki; 

But with the addition of other columns, such as id

I can not understand how to do it, tell me, please.

Already tried the subquery and join, but it does not work

  • And what does "select all other columns" mean? if you have two entries with seria = 1, and in the other field one entry has the value 1, and the second has the 2nd, which value should be shown in that single entry to be selected? read also about group by ru.stackoverflow.com/a/599802/194569 - Mike
  • And you can not pre-sort, and then filter? - Mazahaka-7
  • @mike, group by also tried, didn’t work out - Mazahaka-7
  • @Mike, I, of course, can choose all the series unique, and then in the cycle for each series choose limit 1, with order by price, for example, but it will be too ... - Mazahaka-7
  • Yeah, i.e. Do you need a record, for example with a minimum price? - Mike

0