Query Builder Help - Joins
Can anyone point me in the right direction for doing joins in query builder?
Thanks!
Brian
[email protected]
Click on the left side of the screen at the
arrow. Type in the where clause without
actually typing in "where". You can actually include the columns in the where clause by checking on the columns in the tables present on the right side. Once you are done, press ENTER.
You are done creating where clause. You can look at the SQL it created for you by clicking on the menu button called "show SQL".
Hope that helps,
Oracle University Instructor.
P.S: If you attend one of our reports or forms - I class we teach this in class. Moreover, the course material we give out has a complete section on Report Builder.
Go to http:\\education.oracle.com for more info on class info.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Brian Burk ([email protected]):
Can anyone point me in the right direction for doing joins in query builder?
Thanks!
Brian
[email protected]<HR></BLOCKQUOTE>
null
Similar Messages
-
Hello Everybody,
I am having a table and the sample data is as follows :
<pre>
ord_no tr_date party itemname fab ref cref col1 col2 col3 col4 size1 pcsize1 size2 pcsize2 size3 pcsize3 size4 pcsize4 size5 pcsize5 size6 pcsize6 rate
1111 6/3/2009 ALBERT JUGNU TOP LONG SLEEFS =XS CAMBRIC 123 12234 HEENA CHOCO BROWN RED S-Small 10 M-Medium 20 L-Large 30 XL-Extra Large 40 FS-Free Size 50 FS-Free Size 60 120
1111 6/3/2009 ALBERT KAMAL HOLE TOP M=S HANDLOOM 123 12 HEENA CHOCO BROWN RED S-Small 5 M-Medium 20 L-Large 30 XL-Extra Large 40 FS-Free Size 50 FS-Free Size 60 120
</pre>
The desired output is like :
eg.
<pre>
Fabric color Nos
CAMBRIC HEENA (SUM OF ALL PCSIZE1-6 FIELDS)
CAMBRIC CHOCO (SUM OF ALL PCSIZE1-6 FIELDS)
CAMBRIC BROWN (SUM OF ALL PCSIZE1-6 FIELDS)
HANDLOOM HEENA (SUM OF ALL PCSIZE1-6 FIELDS)
HANDLOOM RED (SUM OF ALL PCSIZE1-6 FIELDS)
</pre>
Pl. Help me to find a solution to this query.
Thanks and Regards
Neeraj
Edited by: ora-boy on Jun 3, 2009 10:40 AM
Edited by: ora-boy on Jun 3, 2009 10:42 AMWith 10g
/* Formatted on 2009/06/03 14:31 (Formatter Plus v4.8.8) */
WITH t AS
(SELECT 1111 ord_no, TO_DATE ('2009/03/06', 'yyyy-mm-dd') tr_date,
'ALBERT' party, 'JUGNU TOP LONG SLEEFS =XS' itemname,
'CAMBRIC' fab, 123 REF, 12234 cref, 'HEENA' col1, 'CHOCO' col2,
'BROWN' col3, 'RED' col4, 'S-Small' size1, 10 pcsize1,
'M-Medium' size2, 20 pcsize2, 'L-Large' size3, 30 pcsize3,
'XL-Extra Large' size4, 40 pcsize4, 'FS-Free Size' size5,
50 pcsize5, 'FS-Free Size' size6, 60 pcsize6, 120 rate
FROM DUAL
UNION ALL
SELECT 1111, TO_DATE ('2009/03/06', 'yyyy-mm-dd'), 'ALBERT',
'KAMAL HOLE TOP M=S', 'HANDLOOM', 123, 12, 'HEENA', 'CHOCO',
'BROWN', 'RED', 'S-Small', 5, 'M-Medium', 20, 'L-Large', 30,
'XL-Extra Large', 40, 'FS-Free Size', 50, 'FS-Free Size', 60,
120
FROM DUAL)
SELECT fab,color,nos
FROM t
model partition by (fab)
dimension by (1 rn)
measures( col1 color, col1,col2,col3,col4,pcsize1+pcsize2+pcsize3+pcsize4+pcsize5+pcsize6 nos)
(color[2]=col2[1],
color[3]=col3[1],
color[4]=col4[1],
nos[2] =nos[1],
nos[3] =nos[1],
nos[4] =nos[1]);
FAB COLOR NOS
CAMBRIC HEENA 210
CAMBRIC RED 210
CAMBRIC BROWN 210
CAMBRIC CHOCO 210
HANDLOOM HEENA 205
HANDLOOM RED 205
HANDLOOM BROWN 205
HANDLOOM CHOCO 205
8 rows selected. -
Hello, I am hoping someone can provide me with a query that can give me a list of all reoccurring scheduled instances, what time they are scheduled for and list of report parameters.
I have searched all over but to no avail. This would be such a great help.
Thank you,
ShaneSELECT top 10000
SI_ID,
SI_KIND,
SI_NAME,
SI_SCHEDULEINFO.SI_MACHINE_USED,
SI_SCHEDULEINFO.SI_DESTINATIONS,
SI_SCHEDULEINFO.SI_SCHEDULE_TYPE,
SI_SCHEDULEINFO.SI_SUBMITTER,
SI_SCHEDULEINFO.SI_STARTTIME,
SI_STARTTIME,
SI_ENDTIME,
SI_SCHEDULE_STATUS,
SI_STATUSINFO,
SI_SCHEDULEINFO.SI_OUTCOME,
SI_PROCESSINFO.SI_HAS_PROMPTS,
SI_PROCESSINFO.SI_WEBI_PROMPTS,
SI_PROCESSINFO.SI_FILES,
SI_PROCESSINFO.SI_PROMPTS,
SI_PROCESSINFO.SI_FULLCLIENT_PROMPTS
FROM CI_INFOOBJECTS
WHERE SI_SCHEDULE_STATUS = 9 -
How to specify an outer join in query builder
I've very quickly built a large query with the query builder, and it works fine, but only produces 9 out of 2200 records - so I need to change it to an outer join.
My problem is that I can't seem to find a way to specify an outer join. I've tried editing the query that query builder formed, but it won't let me.
I know I can capture the query, edit it and run it in sql developer, and that works fine, but I want to use query builder as it is the fastest way I know of to quickly add and remove items - my users are unsure of exactly what to include.
I know it is kind of a trivial question, but i've searched the forum, the manual, the web and no luck
Thanks for any help you can give
GlennHi Glenn,
When you use the Query Builder to create the sql statement, you should click on the empty square to the right of the fields on each table to create the join. When you've done this, you should see a line drawn between the two tables. Click on this line and a small popup appears allowing you to select inner, left outer or right outer joins.
Once the report has been created, though, you need to edit the statement. For example, if you use the Query Builder to join DEPT to EMP based on the DEPTNO field on both tables, you get:
select "DEPT"."DEPTNO" as "DEPTNO",
"DEPT"."DNAME" as "DNAME",
"DEPT"."LOC" as "LOC",
"EMP"."EMPNO" as "EMPNO",
"EMP"."ENAME" as "ENAME",
"EMP"."JOB" as "JOB",
"EMP"."MGR" as "MGR",
"EMP"."HIREDATE" as "HIREDATE"
from "EMP" "EMP",
"DEPT" "DEPT"
where "DEPT"."DEPTNO"="EMP"."DEPTNO"Change this to:
select "DEPT"."DEPTNO" as "DEPTNO",
"DEPT"."DNAME" as "DNAME",
"DEPT"."LOC" as "LOC",
"EMP"."EMPNO" as "EMPNO",
"EMP"."ENAME" as "ENAME",
"EMP"."JOB" as "JOB",
"EMP"."MGR" as "MGR",
"EMP"."HIREDATE" as "HIREDATE"
from "EMP" "EMP"
LEFT OUTER JOIN "DEPT" "DEPT" ON "DEPT"."DEPTNO"="EMP"."DEPTNO"Andy -
How to build table join query in Jdeveloper
Hi,
Can someone tell me how to build table join query in Jdeveloper's Expression Builder UI?[Is it possible to create a table of contents in Crystal Reports?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313335333133303330%7D.do]
-
Query builder bug in outer joins ?
I understood that if you were joining two tables A and B, the following was a
LEFT OUTER JOIN
SELECT A.COL, B.COL
FROM A, B
WHERE A.ID = B.ID (+)
ie: a LEFT outer join has the (+) on the Right-hand table.
However, query builder puts the (+) on the Left-hand table.
Same for a RIGHT outer join - I think the (+) should be on the Left-hand table, but query builder puts it on the Right-hand table.
Cheers,
Andrew
(running Version 2.1.0.00.39)Hi Andrew,
I just played a little with the query builder and created a join between two of my tables:
PROJECTS and ACTIVITIES, linked via KCC.
When I create a left outer join in query builder, I get the following result:
select "PROJECTS"."KCC" as "KCC"
from "ACTIVITIES" "ACTIVITIES",
"PROJECTS" "PROJECTS"
where "PROJECTS"."KCC"(+) ="ACTIVITIES"."KCC"
Which is correct: Left refers to the first table in the from clause (ACTIVITIES) and places the (+) on the other table!
Left and right refers to the order of tables in the from clause, not in the where clause. Query builder sorts the tables in FROM alphabetically, maybe this is differing from the graphical order in query builder.
Regards
Alex -
Configure "Query Builder" for Theta-Style Joins over ANSI-Style Joins
Can SQL Developer be configured to auto generate theta-style joins instead of ANSI-style joins when building queries? This happens when I generate a query using the Query Builder and then switch over to the Worksheet tab to see the SQL code.
Sample code:
Theta-style join syntax uses commas to separate multiple table names and creates the joins in the Where clause:
SELECT c.name
FROM instructors i, courses c
WHERE i.firstname = 'Mary' AND i.lastname = 'Williams'
AND i.course_id = c.course_id;
ANSI syntax uses the JOIN and ON keywords instead:
SELECT c.name
FROM instructors i JOIN courses c
ON i.course_id = c.course_id
WHERE i.firstname = 'Mary' AND i.lastname = 'Williams';Hi Wes,
There is no preference for configuring this that I know of, but Query Builder is fairly clever about detecting your flavor of SQL from the worksheet then sticking with it. If you design it graphically, the default flavor is ANSI, but QB seems to respect any worksheet edits that switch it to another flavor. I wouldn't vouch for that absolutely, but perhaps it's behavior you can take advantage of.
Regards,
Gary
SQL Developer Team -
1.1 query builder join between tables
In the latest Sql Developer.
I invoke the query builder and select multiple tables that have foreign keys between them. These foreign key relationships appear in the diagram (good job).
How do I make those relationship appear in the SQL that query builder returns to the sql worksheet. I shouldn't have to re-specify them on the where/criteria tab.
It would be nice if these relationships are defaulted in the joining of tables.I overlayed the pre-release versionsDo you mean you installed in the same directory?
Don't do that.
There's a system directory (sqldeveloper\sqldeveloper\system) which holds settings and everything, which very well might be corrupted to be used for a newer release.
Try deleting it, it will be regenerated at next startup. Or even better: re-install in another directory all together...
K. -
All,
I am new to using Query Builder, but I found a tutorial at:
http://otn.oracle.com/products/forms/htdocs/d2k/qb/qb1.htm
When I got to the last slide, it make reference to the "Query Builder Online Help", but I cannot find it. Can anyone help?Hi,
http://www.oracle.com/technology/products/database/application_express/index.html
http://www.oracle.com/technology/products/database/application_express/html/doc.html
Good Reading,
Sim -
Hi,
I am trying to get a daily statistics of failed instances using Query Builder. I tried to use fields like SI_UPDATE_TS and SI_STARTTIME to filter instances with in a date range, but date range functions does not seem to work. Is there documentation somewhere as to which fields can be used or how the query should be formatted to get results like this?
Thanks
AjithHello Ajith,
The Query Builder interface is actually rather limited, as you have found out yourself. I don't know if you have any programming experience, but the Query Builder is nothing more than an interface which will use the SDK in the background to talk to the CMS. In other words, if you know how to program for your BO XI deployment (Java or .NET), you can write the logic necessary to retrieve whatever information you want. You'll also find that the SDK documentation contains an explanation (though sometimes limited) for the properties and members that are available.
Although using the SDK might seem overwhelming at first, it's actually quite easy and far more powerful than the Query Builder alternative. Also, Business Objects hosts quite a few code samples that should easily get you started. There's also a dedicated SDK forum for all specific issues relating to development.
Some links to get you up and running:
[Developer Library|https://boc.sdn.sap.com/developer/library]
[Code Samples|https://www.sdn.sap.com/irj/sdn/businessobjects-samples]
[Business Objects SDK Application Development Forums|https://www.sdn.sap.com/irj/sdn/businessobjects-sdk-forum]
Hope this helps!
Kind regards,
Kristof -
I am running windows xp with Oracle 9i Net client to connect to 8.1.7 database. I need to know if any one knows if query builder is bundled in any package certified for XP.
I have query builder in forms 6i but it does not work under XP. I noticed that Jdeveloper has a product called query builder, but looks nothing like the one in forms 6i. Is
this a totally differnt product or it's replacment?
Thanks for any help.Hi Dave,
In 9i, Query Builder stand alone has been obsoleted. It's still accessible in the Reports Builder, but I don't know if that helps you.
Toby -
Help with Query Builder please
Hi,
I would like to query the system database for reports using ftp, email, and unmanaged disk as Destinations. I am not familar with the datafields in the BOXI database nor with the Query Builder syntax or SQL type queries. Can someone provide samples of this type of query and possibly the exact field names to be included.
I would actually like to design a Crystal report that would return this information as needed. Something like...
Report name Report location Type of Destination Actual Destination specified
Any and all assistance would be greatly appreciated.Unfortunately these properties are nested within the results you will receive if you query for any of your individual reports within Query Builder. Try this out for reference:
select top 1 * from ci_infoobjects
where si_name = 'YOURREPORTNAME'
and si_instance = 1
Nested properites cannot be included in the select clause of your query. For the majority of nested properties such as instance destinations, you'll need to either develop script to retrieve this information or utilize a 3rd party product (System Profiler, etc) that has this information available and pre-build reports. -
Seibel Query help : - Joining Order table with Asset or CX_ACTION table.
Hi Team
I need help joining the Order table with the Asset table
or the Order table with CX_ACTION table to
Can i get reference on this .
select x.x_msisdn,
x.x_product_name,
x.x_action,
x.x_status_outcome,
a.recovered_dt,
x.x_amount,
x.created,
x.x_number_retries,
o.ORDER_NUM "FMW Order No",
DECODE(FULFLMNT_STATUS_CD , 'Failed','Failed', o.STATUS_CD) "Order Status"
from
siebel.cx_action x,
siebel.s_order o,
siebel.s_asset a
where a.row_id = x.x_asset_id
and x.created > to_date('08/01/2013 08:00:00', 'dd/mm/yyyy hh24:mi:ss')
and x.created < to_date('09/04/2013 07:50:00', 'dd/mm/yyyy hh24:mi:ss')
RegardsI'm not familiar with Seibel or any of these tables but right off the bat I'd suggest you're missing a join predicate to your s_order table. This could give you far more rows than you're expecting.
Aside from that you haven't told us what problems you are having. An error? Wrong results? Performance? -
How to use Query Builder in Oracle10g
Since I'm new to Oracle , thus I'm facing some problem in some portions. When I went through the Query Builder option, actually I was not able to build the query as some of the features present in it were not clear to me like the "Condition" part and if I need to perform some join in it, how would that part work on it.
Please reply and help me out. Thanks.
Regards,
Praveen RaiQuery Builder is level 8.0, it's part of desupported developer 6i. Installation media has an online manual, which answers your questions. You should consider an alternative like SQLDeveloper. Query Builder may still work with 10g, but no guarantee.
Werner -
Need ABAP Query Builder Like Ms-SQLQuery Builder for Critical ABAP-Query
Dear ABAP Friends,
I Need ABAP Query Builder which is as flexible as Ms-SQLQuery Builder for building Critical ABAP-Queries e.g. "I have 4 master tables , Each master table having self-join with some condition and these 4 Result-Sets have Innser-Join+Left Outer Join " Please Help.I have seen TCODE SQ01, But I found that this TCODE may be used to build simple ABAP Query with Selection-screen which can be used for generating simple report. But i think for critical query ??????????
I have build my Query in MS-SQL and got the right output, Now how do I write this in ABAP Using Join statement. Please Help.....................
My SQL Query as below(Remember this is a single Query and verified correct in SQL):
SELECT P1.PERNR, P1.ENAME, P1.BEGDA AS P1BEGDA, P1.ENDDA AS P1ENDDA, P1.AEDTM AS P1AEDTM, P1.UNAME AS P1UNAME, P1.PERSG, P1.PERSK,
P1.PLANS,
P2.ENDDA AS P2ENDDA, P2.BEGDA AS P2BEGDA, P2.AEDTM AS P2AEDTM, P2.UNAME AS P2UNAME, P2.GESCH, P2.FAMST,
P21.ENDDA AS P21ENDDA, P21.BEGDA AS P21BEDDA, P21.AEDTM AS P21AEDTM, P21.UNAME AS P21UNAME, P21.FAMSA, P21.FAVOR, P21.FANAM,
P21.FGBDT, P21.FASEX,
P0.ENDDA AS P0ENDDA, P0.BEGDA AS P0BEDDA, P0.AEDTM AS P0AEDTM, P0.UNAME AS P0UNAME, P0.MASSN,
P0.MASSG
FROM (SELECT TOP (100) PERCENT PA0001_2.PERNR, PA0001_2.ENDDA, PA0001_2.BEGDA, PA0001_2.AEDTM, PA0001_2.UNAME, PA0001_2.PERSG,
PA0001_2.PERSK, PA0001_2.PLANS, PA0001_2.ENAME
FROM PA0001 AS PA0001_2 INNER JOIN
(SELECT PERNR, MAX(ENDDA) AS ENDDA
FROM PA0001 AS PA0001_1
GROUP BY PERNR) AS Pi1
ON PA0001_2.PERNR = Pi1.PERNR
AND PA0001_2.ENDDA = Pi1.ENDDA
ORDER BY PA0001_2.PERNR) AS P1 LEFT OUTER JOIN
(SELECT TOP (100) PERCENT PA0000.PERNR, PA0000.ENDDA, PA0000.BEGDA, PA0000.AEDTM, PA0000.UNAME, PA0000.MASSN,
PA0000.MASSG
FROM PA0000 INNER JOIN
(SELECT PERNR, MAX(AEDTM) AS Pi0AEDTM
FROM PA0000 AS PA0000_1
GROUP BY PERNR) AS Pi0 ON PA0000.PERNR = Pi0.PERNR AND PA0000.AEDTM = Pi0.Pi0AEDTM
ORDER BY PA0000.PERNR) AS P0 ON P1.PERNR = P0.PERNR LEFT OUTER JOIN
(SELECT TOP (100) PERCENT PA0021.PERNR, PA0021.ENDDA, PA0021.BEGDA, PA0021.AEDTM, PA0021.UNAME, PA0021.FAMSA, PA0021.FAVOR,
PA0021.FANAM, PA0021.FGBDT, PA0021.FASEX
FROM PA0021 INNER JOIN
(SELECT PERNR, MAX(AEDTM) AS Pi21AEDTM
FROM PA0021 AS PA0021_1
GROUP BY PERNR) AS Pi21 ON PA0021.PERNR = Pi21.PERNR AND PA0021.AEDTM = Pi21.Pi21AEDTM
ORDER BY PA0021.PERNR) AS P21 ON P1.PERNR = P21.PERNR LEFT OUTER JOIN
(SELECT TOP (100) PERCENT PA0002.PERNR, PA0002.ENDDA, PA0002.BEGDA, PA0002.AEDTM, PA0002.UNAME, PA0002.GESCH,
PA0002.FAMST
FROM PA0002 INNER JOIN
(SELECT PERNR, MAX(ENDDA) AS Pi2ENDDA
FROM PA0002 AS PA0002_1
GROUP BY PERNR) AS Pi2 ON PA0002.PERNR = Pi2.PERNR AND PA0002.ENDDA = Pi2.Pi2ENDDA
ORDER BY PA0002.PERNR) AS P2 ON P1.PERNR = P2.PERNR
xxxxx----
Edited by: Goutam Roy on May 5, 2009 1:11 PM
Maybe you are looking for
-
Moved iTunes Media folder, now iMovie can't find it
I moved my iTunes media folder in order to share it between two users on the same iMac, following these instructions: http://support.apple.com/kb/HT1203?viewlocale=en_US&locale=en_US That worked fine, but now iMovie can't find the iTunes media librar
-
Hi, The export command failure in Oracle 10g windows, How to resolve the prblem? D:\oracle\product\10.1.0\admin>expdp scott/tiger@orcl1 schemas=SCOTT directory=TEST dumpfile=Test.DMP logfile=Test.log Export: Release 10.1.0.2.0 - Production on Tuesday
-
How to download ides ecc 6.0 from internet
hi guru, it's urgent how to download ides ecc 6.0 from net. regards subhasis.
-
How di I prevent an automatic computer restart after exe install?
How do I stop the msi installer from restarting the computer after installing an exe? I have built an installer package of an application using LabView Project. When running the SetUp.exe the msi installer is automatically restarting the computer af
-
CS5 Master Collection release date
CS3 was released 4th quarter 2007. CS4 was released 4th quarter 2008. Will CS5 be released 4th quarter 2009? I have CS3 Master Collection running on Vista Ultimate 64-bit with 16GB RAM, quad core CPU, 1GB video card. Not sure if it is worth upgrading