Skip to content
Advertisement

Oracle SQL Groupby and SUM

I have the following query that groups every tender id and description and shows its total Sum:

In the table C (SA_TRAN_HEAD), there is a field of TRAN_DATETIME. I want the query to return the results falling between an interval of dates but do not want the date to appear in the query columns.

What could I do to achieve this ?

Advertisement

Answer

Just add the desired date range to the WHERE clause:

I also suggest you get used to using ANSI join syntax, as it makes the joins much clearer and is more transportable (particularly for outer joins). The following should be equivalent:

This makes it clear what the join criteria are, as opposed to the filter criteria.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement