There is a table called A.
If A has 10 data, compare these 10 data under certain conditions
조건에 맞는 데이터들만 뽑으려면 어떻게 해야하나요?
EX) Outputs a list of data of which the value of the column id is different among the records in Table
sql
SELECT DISTINCT(column) FROM table
This ensures that the id value is printed without duplication.
Are you asking me this?
Or maybe you were asking this.
There's a column called pk (primary key) and a column called user_id on the table ABC, and if user_id wants to pull out anything that's different, you can do this.
select *
from (SELECT max(pk) as pk FROM ABC group by user_id) as A join ABC on A.pk = ABC.pk
© 2024 OneMinuteCode. All rights reserved.