Reputation: 119
I'd like to create this structure in sql (as a result of SELECT statement):
I'm trying to do it by using this query:
SELECT "Name" AS School, (SELECT 20 AS "1", 50 AS "2", 90 AS "3") AS Age;
But it doesn't work, error: Operand should contain 1 column(s)
. Is it possible to create something like this using only select statements?
Upvotes: 0
Views: 66
Reputation: 93694
That sort of formatting is not possible in SQL
but this is possible
SELECT 'Name' AS School, 20 AS `Age1`, 50 AS `Age2`, 90 AS `Age3`
Upvotes: 2