Let's assume I have 3 tables: videos, books, albums and I would like a query that gives me the 3 latest entries in each table, along with a column "media_type" valued Video, Book, or Album, accordingly.
I know how to get the 3 latest entries from each table, but how do I create the temporary column?
SELECT b.*, 'books' as table_name FROM books b? – dezso Dec 3 '12 at 20:24