Home » SQL & PL/SQL » SQL & PL/SQL » Problem in creating view
Problem in creating view [message #327166] Sat, 14 June 2008 07:36 Go to next message
Nusrat
Messages: 38
Registered: June 2007
Location: Mumbai(India)
Member
Hi

I have a problem in creating views using Procedure based on condition

We have two tables EMP and DEPT

Table EMP have some data

Ename---- deptno
AAA ---- 10
BBB ---- 10
CCC ---- 20
DDD ---- 20
EEE ---- 30

Dept
Deptno-----Dname
10 -----D1
20 -----D2
30 -----D3

Now i want to create some view according to the number of records availabe in DEPT.
Example:

View_D1
AAA --- BBB

(AAA and BBB is the ename of EMP table but it should be the column name of this view ,column may vary according EMP data)

View_D2
CCC----DDD

View_D3
EEE

All the above views should be empty

Thanks in advance
Nusrat

[Updated on: Sat, 14 June 2008 07:37]

Report message to a moderator

Re: Problem in creating view [message #327175 is a reply to message #327166] Sat, 14 June 2008 08:42 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/t/88153/0/
Please read & follow Posting Guidelines as stated in URL above


>I have a problem in creating views using Procedure based on condition

I don't understand what this means.

I don't see any problem/error.

>All the above views should be empty
I don't understand what this mean.

http://www.orafaq.com/forum/t/88153/0/
Please read & follow Posting Guidelines as stated in URL above
Re: Problem in creating view [message #327184 is a reply to message #327166] Sat, 14 June 2008 10:03 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is a classical "pivot" query answered more than once per day this week.

Regards
Michel
Previous Topic: Outer Join two derieved table with where clause
Next Topic: Partition on table
Goto Forum:
  


Current Time: Thu Dec 08 14:27:01 CST 2016

Total time taken to generate the page: 0.07105 seconds