V
V
vasilijvasenko9732020-05-06 09:19:48
MySQL
vasilijvasenko973, 2020-05-06 09:19:48

Is such a MySQL query possible?

Interested in whether it is possible to make an sql query so that he can select a result in which a unique combination of rows from different columns, for example:

1, пельмени, 1 кг, 300 р
2, пельмени, 1 кг, 300 р
3, пельмени, 500 гр, 150 р
4, пельмени, 1 кг, 300 р

Uniqueness by the last three columns in the table, and the result is two rows:
пельмени, 1 кг, 300 р
пельмени, 500 гр, 150 р

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2020-05-06
@vasilijvasenko973

Read aboutGROUP BY

N
Nikolay Panaitov, 2020-05-06
@Picknice

SELECT * FROM table GROUP BY CONCAT(a,b,c) - Where table is the name of the table, a,b,c are the table fields that need to be collected into a common row and grouped by it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question