Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Self join in Oracle Post Reply Post New Topic
Author Message
ssmith001
Newbie
Newbie


Joined: 18 Jan 2008
Location: United States
Online Status: Offline
Posts: 1
Quote ssmith001 Replybullet Topic: Self join in Oracle
     Posted: 18 Jan 2008 at 3:42pm

I am a new CR user and I have a question. Does anyone know if you can join a table to itself using CR 10? I can run this query in SQLPLUS so I know it works.

select lpad(' ',level*9) || ' ' || name

from pricezonetree_pp

connect by prior pricezoneid = parentid

 

IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 21 Jan 2008 at 6:46am
Hi SS,
 
What you can do is create a view at backend and the use the view in the report which is  the best approach if you need to use selfjoin queries in crystal ...

or else you can use command object in crystal ,I am not sure for the syntax for oracle backend,try copying the same query as in oracle and paste in command object .
 
 
Cheers
Rahul
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 21 Jan 2008 at 10:58am
Or, you can select the table twice in the Database Expert.  When you do this, Crystal will tell you the table is already in the report and ask if you want to add an alias - select 'Yes'. 
 
This will add your table with an "_1" at the end of the name.  You can then link the two however you need to.
 
-Dell
 
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum