0

Is it possible to crosstab a table in PostgreSQL without having to define an "as" clause given by a tuple (column type)?

Example: The created table "t" would have only 3 columns '1', '2' and '3'.

CREATE TABLE IF NOT EXISTS t (
   id_ INTEGER  NOT NULL,
   value1 INT NOT NULL
)

INSERT INTO t (id_, value1) VALUES
(1, 10),
(1, 20),
(2, 10),
(2, 20),
(2, 20),
(3, 30),
(3, 20)
1
  • "without having to define an "as" clause given by a tuple" - no, not possible
    – user1822
    Nov 26, 2021 at 10:28

1 Answer 1

0

"without having to define an "as" clause given by a tuple" - no, not possible @a_host_with_no_name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.