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 |
Sep 7 2018, 12:40 AM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
That doesn't help much. Customers contains no data and CustomersArt contains 1 row. Since there is no matching row in Customers nothing is returned.
Let me try to explain what the query does. Customers is considered the header table while CustomersArt is considered the detail table. The query will return all rows in the header table. When a matching row is found in the detail table then the detail row data is returned along with the header row data. Since the table Customers is empty no data is returned. Exactly what do you want the query to do? This post has been edited by CharlesEF: Sep 7 2018, 01:06 AM |
tudsy |
Sep 7 2018, 01:05 AM
Post
#3
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
That doesn't help much. Customers contains no data and CustomersArt contains 1 row. Since there is no matching row in Customers nothing is returned. Exactly what do you want the query to do? Thanks for that. I want the visitor to look at his/her data (the whole database) using his/her email address. |
CharlesEF |
Sep 7 2018, 01:48 AM
Post
#4
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
I want the visitor to look at his/her data (the whole database) using his/her email address. |
Lo-Fi Version | Time is now: 23rd April 2024 - 07:10 AM |