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

SQL: Disorder

daco2020 2022. 6. 25. 17:00
반응형

You are given a table numbers with just one column, number. It holds some numbers that are already ordered.

You need to write a query that makes them un-ordered, as in, every possible ordering should appear equally often.

 

Solution:

SELECT
  * 
FROM 
  numbers 
ORDER BY random()

 

 

반응형

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

First and last IP in a network  (0) 2022.06.27
SQL Basics - Trimming the Field  (0) 2022.06.26
Adults only (SQL for Beginners #1)  (0) 2022.06.25
SQL: Padding Encryption  (0) 2022.06.23
Sum of angles  (0) 2022.06.22