Another SQLP question #2463
Replies: 3 comments 2 replies
-
Switched to COPY(
SELECT fqdn,
MAX(CASE WHEN row_num = 1 THEN host END) AS NS1,
MAX(CASE WHEN row_num = 2 THEN host END) AS NS2,
MAX(CASE WHEN row_num = 3 THEN host END) AS NS3,
MAX(CASE WHEN row_num = 4 THEN host END) AS NS4,
MAX(CASE WHEN row_num = 5 THEN host END) AS NS5,
MAX(CASE WHEN row_num = 6 THEN host END) AS NS6,
MAX(CASE WHEN row_num = 7 THEN host END) AS NS7,
MAX(CASE WHEN row_num = 8 THEN host END) AS NS8,
MAX(CASE WHEN row_num = 9 THEN host END) AS NS9,
MAX(CASE WHEN row_num = 10 THEN host END) AS NS10,
MAX(CASE WHEN row_num = 11 THEN host END) AS NS11,
MAX(CASE WHEN row_num = 12 THEN host END) AS NS12,
FROM
(
SELECT fqdn, host, ROW_NUMBER()
OVER (PARTITION BY fqdn ORDER BY host) AS row_num
from '$GLUEIN'
) Z
group by Z.fqdn
order by Z.fqdn
) TO '$GLUEOUT' (HEADER, DELIMITER ','); works great but when I tried to run it (sans the Is there a way around that, at present? I really would love to see how fast this can get :-)-O |
Beta Was this translation helpful? Give feedback.
-
I'm afraid I can imagine using a combination of the But TBH, that's too much work and if duckDB is working already, I'd stay with it and use qsv for other data-wrangling that duckDB is not able to do. That's why composability is one of qsv's goals. 😉 |
Beta Was this translation helpful? Give feedback.
-
I converted the issue to a discussion so other users can find it more easily. Hope you don't mind @ondohotola . |
Beta Was this translation helpful? Give feedback.
-
As part of m current little project (see #2425) I had to resort to
sqlite3
where I can do something likeWhen I issue
qsv sqlp data.csv t.sql
witht.sql
having:I get this error message
Beta Was this translation helpful? Give feedback.
All reactions