Home  >  Article  >  Backend Development  >  一个mysql查询的有关问题,马上就能结贴

一个mysql查询的有关问题,马上就能结贴

WBOY
WBOYOriginal
2016-06-13 12:40:09704browse

一个mysql查询的问题,在线等马上就能结贴
脑子糊涂了绕不过来这个弯  求助

我有两个表,t1表存储数据,t2表存储t1表字段的中文名称

t1



t2表



现在想写一条sql语句,能够查出t1表里 id in (1,2,3,4,5)的这几条记录每一个字段值的和,并且把字段名替换成t2表里对应的中文字段名,

结果类似于
array(
   "攻击时附加" =>  6,
   "暴击效果" => 7,
   ....
)

语句应该怎么写?   本来感觉应该不难的怎么就突然想不出来了   脖子都快抽筋了

是不是表设计的有问题? 有没有更好的方式

mysql 表设计 查询
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn