Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
SELECT   txtdtTrans_Date 
FROM (SELECT  1+ ROWNUM - 1 txtdtTrans_Date 
FROM dual
CONNECT BY ROWNUM <= ((TO_DATE('10/01/2021', 'dd/mm/yyyy')+1)-TO_DATE('01/01/2021', 'dd/mm/yyyy')) )


What I have tried:

above given query working in oracle sql developer but i need it in postgre sql
Posted
Updated 15-Jul-21 8:09am
v2
Comments
SeeSharp2 15-Jul-21 14:11pm    
You are lazy. Why not do what Maciej did and google it? Shame shame.
chilukuri sumanth reddy 15-Jul-21 21:57pm    
what i need actuly in backend 2 columns there from date and to date .

in from date 2021-05-01 and todate 2021-05-05 .


now i need output like 5 row of data
SeeSharp2 16-Jul-21 7:26am    
Now you are asking for someone to do more easy work for you?
chilukuri sumanth reddy 16-Jul-21 8:36am    
if u know tell me otherwise f*** off
SeeSharp2 16-Jul-21 9:07am    
Lazy and rude.

1 solution

ROWNUM[^] in Oracle corresponds with ROW_NUMBER[^] in Postgres.

CONNET BY[^] referes to recursive cte. See: PostgreSQL: Documentation: 13: 7.8. WITH Queries (Common Table Expressions)[^]

To add 1 day to specific date, use: '2021-07-15' + interval '1 day'

The rest belongs to you!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900