SQL Developer (MOSC)

MOSC Banner

Count records from previous and current date

edited Mar 6, 2025 5:50PM in SQL Developer (MOSC) 11 commentsAnswered

Hi all,

From my flag table I would like to count number of records from previous day and count of record from current day on certain columns in a table for example output should look like this:

Flag ,Previous_Day_Flag , Current_Day_Flag
Flag1 , 2, 1
Flag2, 1, 2
Flag3, 2 , 100

etc. How can I create a sql statement that will show above.

Flag table
Flag1 etc are NUMBER
FlagDate = DATE

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center