我想在sql中创建这个结构(作为SELECT语句的结果):
我正在尝试使用此查询:
SELECT "Name" AS School, (SELECT 20 AS "1", 50 AS "2", 90 AS "3") AS Age;
但它不起作用,错误:Operand should contain 1 column(s)
。是否可以仅使用select语句创建这样的东西?
答案 0 :(得分:2)
在SQL
中无法使用格式,但这是可能的
SELECT 'Name' AS School, 20 AS `Age1`, 50 AS `Age2`, 90 AS `Age3`