![]() The output of the “UNION” will be without duplicate rows. MySQL Union combines the output of two or more “SELECT” statements.Things that need to remember are as below: – Insert into st_marks_bkup values ('Music Class', 67) Ī screenshot for the above is given below: – ![]() Insert into st_marks_bkup values ('Art', 43) Insert into st_marks_bkup values ('Chemistry', 67) Insert into st_marks_bkup values ('Physics', 78) Insert into st_marks_bkup values ('Mathematics', 93) Insert into st_marks_bkup values ('English', 98) Insert into st_marks values ('Music Class', 67) īackup table:- create table St_marks_bkup Insert into st_marks values ('Chemistry', 67) Insert into st_marks values ('Physics', 78) Insert into st_marks values ('Mathematics', 93) Insert into st_marks values ('English', 98) As we know that the UNION doesn’t give us duplicates the output of the tables should be rows of only one table: – Now, let us consider the backup table and check if all the rows have been inserted into the table “st_marks”. “st_marks_bkup” is a backup table that has some data in it. Here we have “st_marks” and “st_marks_bkup”. Now let us see another example of real-time. But in the result set, UNION ignores the duplicate because we have only one row of data, “1”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |