Here's a hidden trick inside SQL .
,,
An easy way to generate records from scratch is using an easy CONNECT BY against DUAL.
e.g. you need a Forms-LOV which shows the last 12 months.
So you have to create a record-group-select which gives you exactly 12 records. After that you combine it with sysdate. Let's see:
e.g. you need a Forms-LOV which shows the last 12 months.
So you have to create a record-group-select which gives you exactly 12 records. After that you combine it with sysdate. Let's see:
SELECT Level LVL FROM Dual CONNECT BY Level <= 12;
then you integrate the sysdate into the statement:
SELECT add_months (trunc (sysdate, 'MM'), -1*Level) Month FROM Dual CONNECT BY Level <= 12; ,,
Thanks to
No comments:
Post a Comment