Convert Access Sumary Query to Oracle Pass Through Query
I have a summary query in Access which has several Fields that use the First Or Last options. There is no equivolent function in Oracle. Does anyone know how to do this in oracle?
Simplified version of Access Query:
SELECT CustName, First(AcctType), Last(SalesPerson), Sum(MonthlySales) FROM CustSales WHERE SalesMonth Is Not Null And SalesYear = 2007 GROUP BY CustName;
It's because first and last dont really make sense without some kind of order.
I suggest that you use analytical functions:
MIN(salary) KEEP (DENSE_RANK FIRST ORDER BY commission_pct) "Worst",
MAX(salary) KEEP (DENSE_RANK LAST ORDER BY commission_pct) "Best"
GROUP BY department_id;
By corygibbons in forum Database
Last Post: 07-11-2007, 09:30 PM
By kylemcna in forum ASP.NET
Last Post: 04-13-2007, 03:23 AM
By Ron Weller in forum VB Classic
Last Post: 10-12-2006, 07:23 PM
By jonaz in forum VB Classic
Last Post: 03-16-2006, 06:31 PM
By Larry Muller in forum VB Classic
Last Post: 02-24-2001, 11:12 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center