我有这个问题:
SELECT * FROM `people` WHERE `age` > '19' ORDER BY `id` DESC LIMIT 10
| id | name | age |
-------------------------
| 1 | a | 842479200 |
-------------------------
| 2 | b | 748562400 |
-------------------------
age
行包含时间戳。
如何将它转换为年龄,如15,14,20,25?
答案 0 :(得分:0)
您需要使用以下内容转换为正确的格式:
SELECT people, name, strftime("%Y-%d-%m", age, 'unixepoch') AS age
FROM `people` WHERE `age` > '19' ORDER BY `id` DESC LIMIT 10