You will have to configure the following steps if you want to combine more than two tables using the UNION operator – How to Execute SELECT Statement with SQL UNION You can use this statement to combine both tables using union with a WHERE clause SELECT name FROM students You can use this statement to combine both tables using union with a GROUP BY SELECT COUNT(id), city You can use this statement to combine both tables using union with an ORDER BY. You can use the following formats to combine both tables students & employees – UNION with ORDER BY The students’ table contains the following values – Id int(10) PRIMARY KEY NOT NULL AUTO_INCREMENT, Here the query to create students table – CREATE TABLE students Now, We will get a new table by combining these tables – Suppose that we have two tables like students & employees that have four columns like, name & city.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |