我在使用SQLite
的查询中有这样的结果集ID description value
1 name john
2. age 30
3. location kl
我想将结果集转换为像这样的列
name age location
john 30 kl
我该怎么做?
我正在使用SQLite和javascript,angularjs
谢谢
答案 0 :(得分:0)
您可以使用此查询:
SELECT max(case when description = 'name' then value end) as name,
max(case when description = 'age' then value end) as age,
max(case when description = 'location' then value end) as location
FROM YourTable(or query..)