나는 이렇게 학습한다/Algorithm & SQL

SQL Basics: Simple DISTINCT

daco2020 2022. 5. 18. 21:19
반응형

For this challenge you need to create a simple DISTINCT statement, you want to find all the unique ages.

people table schema

  • id
  • name
  • age

select table schema

  • age (distinct)

NOTE: Your solution should use pure SQL. Ruby is used within the test cases to do the actual testing.

 

 

Solution:

SELECT DISTINCT age FROM people;

DISTINCT excludes duplicate values ​​of the corresponding column.

 

 

 

반응형

'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글

Returning Strings  (0) 2022.05.20
Even or Odd  (0) 2022.05.19
Easy SQL: Square Root and Log  (0) 2022.05.17
Collect Tuition (SQL for Beginners #4)  (0) 2022.05.16
Expressions Matter  (0) 2022.05.15