_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › 襴蠍
Describe 襴蠍 here

--螳   襴蠍
--==================
/*
覓語: http://www.soqool.com/servlet/board?cmd=view&cat=100&subcat=1010&seq=94&page=1&position=1

企 test螳  螳 譯殊伎 ,

WITH TEST AS (
  SELECT 'a' col1, 2 col2 FROM DUAL UNION ALL
  SELECT 'b', 3 FROM DUAL UNION ALL
  SELECT 'c', 4 FROM DUAL)

 螳, 螳  襯 col2 襷 れ 豢ロ 貎朱Μ襯 襷れ 覲伎.

col1 col2
---------
a    1
a    2
b    1
b    2
b    3

*/
--願  譬.
WITH TEST AS (
  SELECT 'a' col1, 2 col2 FROM DUAL UNION ALL
  SELECT 'b', 3 FROM DUAL UNION ALL
  SELECT 'c', 4 FROM DUAL)
SELECT
  COL1
, COL2
FROM TEST A INNER JOIN (SELECT LEVEL SEQ FROM DUAL CONNECT BY LEVEL <= 1000) B
ON B.SEQ <= A.COL2 
ORDER BY 1

--覲襦  譬.
WITH TEST AS (
  SELECT 'a' col1, 2 col2 FROM DUAL UNION ALL
  SELECT 'b', 3 FROM DUAL UNION ALL
  SELECT 'c', 4 FROM DUAL)
SELECT
  COL1
, COL2
, RowNo
FROM(
      SELECT
        COL1
      , COL2
      , ROW_NUMBER() OVER(PARTITION BY COL1 ORDER BY COL1) RowNo
      FROM TEST
      CONNECT BY LEVEL <= COL2) T
WHERE RowNo <= COL2
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:52

貂貂 瑚 願 る 螳 企蓋 . 蠏瑚 襷 語 蠍 覓語企. ( 貅)