Friday 14 February 2020

Comma separated list into rows -opposite to listagg

with xxx as
(select 'a,b,c,d' col1 from dual)
select regexp_substr(col1,'[^,]+',1,level) result
from xxx
connect by level = length(regexp_replace(col1,'[^,]+')) +1;

Turns a,b,c,d
into rows
a
b
c
d

Tuesday 23 October 2018

SQL Server , quick row count

SELECT T.name AS [TABLE NAME],

I.rows AS [ROWCOUNT]

FROM sys.tables AS T

INNER JOIN sys.sysindexes AS I

ON T.object_id = I.id

AND I.indid < 2

where T.name like 'mdm_frontend_export_gb1_gb2'

ORDER BY I.rows DESC

Thursday 7 August 2014