Home » SQL & PL/SQL » SQL & PL/SQL » about view
about view [message #233206] Wed, 25 April 2007 03:45 Go to next message
parasuramchekuri
Messages: 32
Registered: March 2007
Location: vishakapatnam
Member
hi all
i ve requirement to create view
in that view
i have two columns from two tables with same datatype and length
that two columns are stored at one column in view


for example

tab1
--------
counter_id varchar2(10)
counter_name varchar2(50)


tab 2:
--------
warehouse_id varchar2(10)
warehouse_name varchar2(50)

my requirement is i ve to create view with two columns
id and name
id stores all the counter and warehouser ids and
name stores the corrsponding counter names and warehouse names
let me know the solution
thanks
Ram...
Re: about view [message #233208 is a reply to message #233206] Wed, 25 April 2007 03:49 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Something like this simple union (or did I miss something?):
CREATE VIEW my_view AS
SELECT counter_id id, counter_name name
  FROM tab1
UNION ALL
SELECT warehouse_id id, warehouse_name name
  FROM tab2;
Re: about view [message #233218 is a reply to message #233206] Wed, 25 April 2007 04:07 Go to previous message
parasuramchekuri
Messages: 32
Registered: March 2007
Location: vishakapatnam
Member
hai
thanks for quick replay
i worked with that and its working
thanks again
Ram...
Previous Topic: Calling stored Procedures
Next Topic: Need help in SQL Join and Ranking
Goto Forum:
  


Current Time: Wed Dec 07 22:29:12 CST 2016

Total time taken to generate the page: 0.10946 seconds