Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GROUP BY FUNCTION

Status
Not open for further replies.

H1004

MIS
Oct 28, 2003
136
0
0
US
In SQL, I can use GROUP BY Work Code and it would give me a list of all the work codes within that table. Is there a same functionality in WebFocus
 
TABLE FILE WORK_CODE
BY WORK_CODE
END

will give a list of codes.

Basically a SUM / MAX / COUNT etc is created on the fly, so if you look at the generated sql it will look something like this

SELECT T1."WORK_CODE", MAX(T1."WORK_CODE") FROM
WORK_CODE T1 GROUP BY T1."WORK_CODE" ORDER BY
T1."WORK_CODE";

In some circumstances this might not be very efficient and you may want to code your own SUM x NOPRINT instead.
 
Try using SQL Passtrought:

SET SQLENG=<Engine Name>
SQL
...
END
 
If your going to a sql database, I would think that you would want to use SELECT DISTINCT WORK_CODE.....

The focus code for this would be
TABLE FILE ...
PRINT DST.WORK_CODE
END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top