![]() Hence, we have mentioned the alias for the table. Here every time mentioning the whole table name in the joining condition would be difficult. Here every time mentioning the whole table name in the joining condition would be difficult.Ĭode: SELECT * FROM SAMPLE_A A JOIN SAMPLE_B B ON A.COL_A = B.COL_A The below example is for the column aliasing:Ĭode: SELECT EMPLOYEE_ID AS "EMPLOYEE ID",Ī table alias is mainly used when we are performing joins on the table.īelow are the sample table with sample data to show how the alias is performed.Ĭode: INSERT INTO SAMPLE_A VALUES (1, 5) Ĭode: INSERT INTO SAMPLE_B VALUES (1, 5) Now let us give an alias to each column above without an underscore in the column name. INSERT INTO EMPLOYEE_INFORMATION VALUES ('E10','SAI','D3', 50000) INSERT INTO EMPLOYEE_INFORMATION VALUES ('E9','RAM','D3', 60000) INSERT INTO EMPLOYEE_INFORMATION VALUES ('E8','PETER','D3', 30000) INSERT INTO EMPLOYEE_INFORMATION VALUES ('E7','DAVID','D2', 40000) INSERT INTO EMPLOYEE_INFORMATION VALUES ('E6','PONY','D2', 70000) ![]() INSERT INTO EMPLOYEE_INFORMATION VALUES ('E5','HARRY','D2', 70000) INSERT INTO EMPLOYEE_INFORMATION VALUES ('E4','FRED','D1', 10000) INSERT INTO EMPLOYEE_INFORMATION VALUES ('E3','SOMY','D1', 50000) ![]() INSERT INTO EMPLOYEE_INFORMATION VALUES ('E2','WILL','D1', 80000) Now let us insert data into the above table:Ĭode: INSERT INTO EMPLOYEE_INFORMATION VALUES ('E1','SAM','D1', 90000)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |