---
title: "sql 行转列"
author: "surfingForRest"
date: "2011-01-13T09:54:44Z"
tags: ["SQL"]
categories: ["数据库"]
slug: "sql"
draft: false
lastmod: "2011-01-13T09:54:44Z"
id: 869963
url: "https://surfingforrest.iteye.com/blog/869963"
---

with a as (select '123,456,789,098' id from dual)
    select regexp_substr(id,'[^,]+',1,rownum) id from a
    connect by  rownum<=length(regexp_replace(id,'[^,]+'))

 :x 不怎么懂，先存一下好了