Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] SQL OUT TWO SELECT STATMENTS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] SQL OUT TWO SELECT STATMENTS
 Login/Join
 
Silver Member
posted
Does anybody know that how can i get data in a SELECT Statment from another select query
for example
SELECT orders.order_id, cart_items.cart_item_id,
z120shipjoin.order_ups_delivered_time,
FROM
JOINS
WHERE CLAUSE


THIS IS THE z120shipjoin QUERY REFERENCED ABOVE
SELECT order_ups_delivered_time etc
FROM
JOINS
WHERE CLAUSE

This message has been edited. Last edited by: <Kathryn Henning>,
 
Posts: 33 | Registered: September 05, 2014Report This Post
Expert
posted Hide Post
SQL
SELECT * FROM CAR
WHERE COUNTRY IN 
    (SELECT COUNTRY FROM CAR WHERE COUNTRY LIKE '%N%')
;
END


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
Thanks Francis for your reply
Let me be more clear;
Our requirements are as under
we are selecting some records from a table using join and union them with same table and same join;
then we select some more records from another table and some of the records from the select/union query
How can i achieve this?
Thanks in advance
 
Posts: 33 | Registered: September 05, 2014Report This Post
Silver Member
posted Hide Post
[SOLVED]
 
Posts: 33 | Registered: September 05, 2014Report This Post
Expert
posted Hide Post
How solved? Might be nice for others to know....


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
Hey Francis,
It was pretty simple.
I created view from one of the Select Statement
and then joined and selected records from the view and another table in another select statement
Here is the code example:

SQL
Create OR Replace view view1 as select * from table1; -*this is the select query that will be referenced later *-
END
SQL
Prepare SQLOUT FOR -* as these columns will be printed later in report *-
Select table2.column1, table2.column2,
view1.column1, view1.column2 from table2 Inner Join view1; -* this is the query that get records from table2 and view that was just created *-
END


WF 8.0.08, Dev Studio, Apache Tomcat/7, MS IIS 7, MySQL, MS Windows 7, I.E. 9, Output formats: HTML, Excel 2007, PDF, Active HTML, Active PDF
 
Posts: 33 | Registered: September 05, 2014Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by Francis Mariani:
How solved? Might be nice for others to know....


Hey Francis,
It was pretty simple.
I created view from one of the Select Statement
and then joined and selected records from the view and another table in another select statement
Here is the code example:

SQL
Create OR Replace view view1 as select * from table1; -*this is the select query that will be referenced later *-
END
SQL
Prepare SQLOUT FOR -* as these columns will be printed later in report *-
Select table2.column1, table2.column2,
view1.column1, view1.column2 from table2 Inner Join view1; -* this is the query that get records from table2 and view that was just created *-
END


WF 8.0.08, Dev Studio, Apache Tomcat/7, MS IIS 7, MySQL, MS Windows 7, I.E. 9, Output formats: HTML, Excel 2007, PDF, Active HTML, Active PDF
 
Posts: 33 | Registered: September 05, 2014Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] SQL OUT TWO SELECT STATMENTS

Copyright © 1996-2020 Information Builders