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?
这种格式在SQL
是不可能的,但这是可能的
SELECT 'Name' AS School, 20 AS `Age1`, 50 AS `Age2`, 90 AS `Age3`
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.