简体   繁体   中英

SQL - basic SELECT statement

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM