Created
August 20, 2020 12:03
-
-
Save gbarreiro/32cc35f1012f88a73f2de2f9067d39d2 to your computer and use it in GitHub Desktop.
MySQL cheatsheet: create view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The sentence below... | |
SELECT (id, name, age) FROM Students UNION ALL SELECT (id, name, age) FROM Teachers; | |
-- ... is the same than... | |
CREATE VIEW People AS SELECT (id, name, age) FROM Students UNION ALL SELECT (id, name, age) FROM Teachers; | |
SELECT * from People; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment