Py学习  »  DATABASE

如何在mysql select return中标识为key

jack williams • 5 年前 • 1422 次点击  

我需要返回mysql查询

SELECT name as id FROM table 

但在mysql中我需要这样的返回(我在数组中编写它,因为它很容易编写)

[
  20: 'Jack',//20 is id from table and Jack is name from table
  40: 'Nano',
  49: 'Hakase'
]
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/46075
 
1422 次点击  
文章 [ 3 ]  |  最新文章 5 年前