Hi everyone
I am frequently asked how to create a custom SQL folder that will generate a known list of values. The following two examples of SQL are identical in their output and you are free to choose the one that you prefer. In terms of performance, the first is more efficient but is a little more difficult to understand.
Both pieces of code produce a folder with two items: an item called PRODLINE and an item called SEQUENCE. You can use the SEQUENCE when creating an alternate sort. Have fun!
SELECT
DECODE(ROWNUM,
1,'MINI-WIDGET',
2,'SUPER-WIDGET',
3,'MEGA-WIDGET',
4,'WONDER-WIDGET') PRODLINE,
ROWNUM SEQUENCE
FROM DUAL
CONNECT BY LEVEL <= 4
or
SELECT 'MINI-WIDGET' PRODLINE, 1 SEQUENCE FROM DUAL
UNION
SELECT 'SUPER-WIDGET' PRODLINE, 2 SEQUENCE FROM DUAL
UNION
SELECT 'MEGA-WIDGET' PRODLINE, 3 SEQUENCE FROM DUAL
UNION
SELECT 'WONDER-WIDGET' PRODLINE, 4 SEQUENCE FROM DUAL
Battle in India for e-commerce market leadership is no longer between just
Amazon and Flipkart
-
Amazon Launches Prime Music in India. What It Means for the Indian
e-commerce Market
O
n a day when it was reported that the online streaming music app Ga...
5 years ago