Assuming that A and W (forinstace) are key columns
Code:
create view apple_orange as
select * from apple a left join orange o on a.A = o.W
Otherwise, can't be done.
In general you did not tell how that view would be something smart, and I cant see it either.
__________________
Found a flower or bug and don't know what it is ? agrozoo.net galery
if you don't spot search button at once, there is search form: agrozoo.net galery search
Last edited by BubikolRamios; 01-21-2013 at 12:50 PM..
To use two tables you'd have to use a JOIN or a UNION. You have given us fake columns so all we can do is guess. Giving clear examples would actually get you a better answer.
To use two tables you'd have to use a JOIN or a UNION. You have given us fake columns so all we can do is guess. Giving clear examples would actually get you a better answer.
guelphdad,
I am glad that I have created a view with the JOIN but I dont see the data is moved but only column is created.
aut_id aut_name country home_city
AUT001 William Norton UK Cambridge
AUT002 William Maugham Canada Toronto
AUT003 William Anthony UK Leeds
AUT004 S.B.Swaminathan India Bangalore
AUT005 Thomas Morgan Germany Arnsberg
Now I want create view which as only below columns in it
cate_id cate_descrip aut_id aut_name
CA001 Science AUT001 William Norton
CA002 Technology AUT002 William Maugham
CA003 Computers AUT003 William Anthony
CA004 Nature AUT004 S.B.Swaminathan
CA005 Medical AUT005 Thomas Morgan
Last edited by nani_nisha06; 01-22-2013 at 07:32 AM..
What does this say ?
Wiliam bought something from category science.
That I was talking about. What did he bought ?
You need two new tables ITEMS and SALES to make any use of all that.
And the one you now call purchase, rename it to buyer or something.
EDIT. In case you persist at what you hawe and to clarify making view:
1. add column to your current purchase table, name it as cate_id
fill that with same data as you have in category table.
Then:
Code:
create foo as
select * from category c left join purchase p on c.cate_id = p.cate_id
any you will get eyactly what you want.
__________________
Found a flower or bug and don't know what it is ? agrozoo.net galery
if you don't spot search button at once, there is search form: agrozoo.net galery search
Last edited by BubikolRamios; 01-22-2013 at 08:41 AM..
__________________
Found a flower or bug and don't know what it is ? agrozoo.net galery
if you don't spot search button at once, there is search form: agrozoo.net galery search