Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用mysql行值作为属性?_Mysql - Fatal编程技术网

如何使用mysql行值作为属性?

如何使用mysql行值作为属性?,mysql,Mysql,我有一个mysql表,如果行值是值_2,我想使用行值,因为属性billow是示例: 表1: 我希望结果是波涛: Attribute_1 Value_2 1 10 2 20 你的帮助是值得赞赏的 谢谢查看您的样本似乎您正在查找别名 select Attribute_1 , Attribute_3 as Value from my_table 不要使用 -减号如果需要,请使用下划线。,或者对具有空格`Attribute 1'的列使用反勾号`

我有一个mysql表,如果行值是值_2,我想使用行值,因为属性billow是示例: 表1:

我希望结果是波涛:

Attribute_1 Value_2  
1            10
2            20    
你的帮助是值得赞赏的


谢谢

查看您的样本似乎您正在查找别名

select Attribute_1 , Attribute_3 as Value
from my_table
不要使用
-
减号如果需要,请使用下划线
,或者对具有空格`Attribute 1'的列使用反勾号`

更新已更改的问题

select Attribute_1 , Attribute_2 as Value_2
from my_table
where Attribute_2 ='value_2'

但是您不应该更改原始问题,否则其他用户无法正确理解答案

属性-1就是一个例子,我已经改变了它。谢谢你的回答,我正在检查。我已经更新了我的问题,请检查。有可能吗?回答更新。。但请记住,这个问题是不公平的,会给其他用户带来困惑
select Attribute_1 , Attribute_2 as Value_2
from my_table
where Attribute_2 ='value_2'