- 2026年07月09日
- 星期四
我有以下mysql查询:SELECT id, sum(views) as total_views FROM table WHERE id IN (1,2,3) GROUP BY id ORDER BY total_views ASC 如果在数据库中只找到id 1,3,我仍然希望出现id 2,其中total_views设置为0.有没有办法做到这一点?这不能使用
我想更改一个表的模式,以便一个Integer字段更改为Varchar一个,但保留数据(以前的数字现在将是字符串).最佳答案试试这个来改变架构:alter table table_name change col_name col_name varchar(10)
