marcothesane
Administrator
marcothesane Administrator
Reactions
-
Re: show partition size
This is more detailed - if you want, for example, to find the 4 biggest partitions in the database: SELECT t.table_schema, t.table_name, p.partition_key, SUM(p.ros_size_bytes) AS ros_size_bytesFROM T… (View Post)1 -
Re: Is it possible to have complex queries on flattened tables referencing dimension tables?
I think you can achieve it using a NVL() function. If a flattened column is NULL because the matching - found - column of the joined row in the dimension table is NULL, then your expression works. If… (View Post)1 -
Re: TIMESTAMPDIFF in HH:MM:SS
Subtracting two timestamps from each other returns an INTERVAL DAY TO SECOND. Up to 23 hours, 59 minutes and 59 seconds, that data type formats like a TIME type. Above 24 hours, it has the days, form… (View Post)1 -
Re: Pivot with non unique IDs
The query should be this: SELECT id, (MAX(CASE fruit WHEN 'Pear' THEN counter END) IS NOT NULL) AS Pear, (MAX(CASE fruit WHEN 'Orange' THEN counter END) IS NOT NULL) AS Orange, (MAX(CASE fruit WHEN '… (View Post)1 -
Re: How to read first element from an arraylist which is stored as varchar
Does this server your purpose? WITH indata(s) AS ( SELECT '[''Baby Unisex'', ''Baby'']'UNION ALL SELECT '[''Pre-Owned'']'UNION ALL SELECT '[''Mens'']'UNION ALL SELECT '[''Boys'', ''Mens'']'UNION ALL … (View Post)1