We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f12ba9 commit 10224e8Copy full SHA for 10224e8
4. Sorting.sql
@@ -0,0 +1,18 @@
1
+-- 1. sort by ascending
2
+select name from student order by id;
3
+
4
+--2 sort by descending
5
+select name from student order DESC by id;
6
7
+-- sort the string from starting index to n letters.
8
+select name from student order by Left(name,3);
9
10
11
+-- sort the string from last index to n letters.
12
+select name from student order by Right(name,3);
13
14
+-- if above 2 matches then under such condition
15
+-- we got to use 'ID' attributes for sort.
16
17
+select name from student order by Left/Right(name,n),ID;
18
0 commit comments