I have table with below data. course_name is in ascending order.
Now, I want to get below combinations of the course_name with help of SQL.
How can I get this?
You need a Cross Join:
WHEN t1.course_name = t2.course_name
FROM tab AS t1 JOIN tab AS t2
ON t1.emp_no = t2.emp_no
AND t1.course_name <= t2.course_name
But why do you want that output?