好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

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

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语句中查询出的数据添加一列,并且添加默认值

标签:

查看更多关于sql语句中查询出的数据添加一列,并且添加默认值的详细内容...

  阅读:25次