Creating a view from multiple tables |
Creating a view from multiple tables |
tudsy |
Aug 5 2018, 11:32 PM
Post
#1
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Hi
I have 4 tables, CustomersArt,Customers,subscribers and emailcomm. My question is, how do i create a view from these 4 tables with the column email ? I have done a view from one table (see below): $query = "CREATE VIEW ecovib2d AS SELECT email FROM CustomersArt"; Any help will be appreciated. |
CharlesEF |
Aug 12 2018, 12:16 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
I don't think so, you need to change the ON part. You must join based on the email address. Also, some of your tables have the same column name. You might have to use an alias for those columns (look in to AS). In other words, you might have to specify column names and not use the * character. And you might want to use table names only once. In my post a = table CustomersArt while b = Customers. I've never created a VIEW so you may have to do some testing.
|
Lo-Fi Version | Time is now: 24th June 2024 - 05:33 PM |