当前位置:Gxlcms > 数据库问题 > sql语句中查询出的数据添加一列,并且添加默认值

sql语句中查询出的数据添加一列,并且添加默认值

时间:2021-07-01 10:21:17 帮助过:22人阅读

select app_id,app_secret from wx_ticket group by app_id;

查询出的数据是

app_id | expires_in
--------------------+------------
wxeec89cdf2d435d10 | 7200
wxeec89cdf2d435d10 | 7200
wx9b7bfb5f59df5009 | 7200
wx9b7bfb5f59df5009 | 7200
wx649ae9eecb72227d | 7200
wx649ae9eecb72227d | 7200

当使用select ‘20150429‘ date,app_id,app_secret from wx_ticket group by app_id;

date | app_id | expires_in
----------+--------------------+------------
20150429 | wxeec89cdf2d435d10 | 7200
20150429 | wxeec89cdf2d435d10 | 7200
20150429 | wx9b7bfb5f59df5009 | 7200
20150429 | wx9b7bfb5f59df5009 | 7200
20150429 | wx649ae9eecb72227d | 7200
20150429 | wx649ae9eecb72227d | 7200
20150429 | wxc01e853c2a2745c9 | 7200
20150429 | wx911d98d37516611c | 7200

sql语句中查询出的数据添加一列,并且添加默认值

标签:

人气教程排行