A
A
Alexey Lebedev2015-06-02 22:42:01
SQL
Alexey Lebedev, 2015-06-02 22:42:01

SQL How to output without repeats and with quantity?

We have such a table, and we get it when querying:
SELECT * FROM table WHERE uid=2;
f45a1b9b43c947799d3a68c83df888a9.png
But there are a lot of duplicated rows, I want to display it like this:
7db70746954946d2b7186a4415607808.png
Ideology:
- take the minimum id
- combine everything where p (parameters are equal)
- WHERE should work and all fields should be
I know how to do this on C#, but if there is an easy solution, then I prefer SQL.
What options?
Or should you not bother with SQL?
Can eat on SQL a variant, but it will be slow.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2015-06-02
@swanrnd

GROUP BY

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question