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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Subqueries in focus
 Login/Join
 
Member
posted
can we write subqueries in focus. I don't want to execute sql but the report requires a subquery. How can we do it in webfocus
let say for e.g
i have query
select * from emp where sal=(select max(sal) from emp);
How can we get result of this query in webfocus. can anyone help me
 
Posts: 14 | Registered: January 11, 2006Report This Post
Virtuoso
posted Hide Post
The FOCUS language does not have subqueries like SQL. However, the following is a example of duplicating the same functionality with a HOLD file.

The first pass of the data creates a file containing the MAX value. the second pass then uses the file in a selection statement to select only records that have the MAX value.

TABLE FILE CAR
SUM MAX.RCOST
ON TABLE SAVE AS MAXVAL
END
-RUN
TABLE FILE CAR
PRINT RCOST DCOST
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
WHERE RCOST IN FILE MAXVAL
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Virtuoso
posted Hide Post
Here's another example of how to get the same result using a multiverb request.

TABLE FILE CAR
SUM MAX.RCOST
PRINT RCOST DCOST
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
WHERE TOTAL RCOST EQ MAX.RCOST
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders