Is it possible to grab data from two tables (that have the same fields) into one view. Basically, so the view sees the data as if it was one table.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, using a UNION –
…requires that there be the same number of columns, and the data types match at each position.
..preferrably, using a JOIN:
But I want to warn against depending on views – if not materialized, they are only prepared SQL statements. There’s no performance benefit, and can negatively impact performance if you build a view based on another. Also, views are brittle – they can change, and you won’t know until using a supporting view if there are issues.