开发者

Using string functions on Alias title using MySQL

开发者 https://www.devze.com 2023-03-03 07:21 出处:网络
I want to name my Alias titles using data from my tables. He开发者_运维技巧re\'s a totally stupid example to show what I want to do:

I want to name my Alias titles using data from my tables. He开发者_运维技巧re's a totally stupid example to show what I want to do:

SELECT id AS CONCAT('id_', name)

Which would give me the output id_5 => 5. (if ID was 5 in the table)


Sounds like what you're after is a pivot - you mean that for each row in the table, you would end up with a new column, right? If so, then just google mysql pivot (sorry, I'm used to sqlserver)

0

精彩评论

暂无评论...
验证码 换一张
取 消