In Sql, we can list same column multiple times by differrent name in sql. We must rename the column using as key word.
Examples:
TO DOWNLOAD THE SAMPLE LİBRARY DATABASE CLICK
1) List student name two times in one query.
1 |
Select name as n1,name as n2 from students |
Result:
2) List all book’s name three times in sql query
1 |
Select name as bookname1,name as bookname2,name as bookname3 from books |
YOU MAY WANT TO SEE OUR ALL EXAMPLES PAGE, THEN CLICK HERE