Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql相关语句 #19

Open
hapiman opened this issue May 3, 2017 · 2 comments
Open

sql相关语句 #19

hapiman opened this issue May 3, 2017 · 2 comments

Comments

@hapiman
Copy link
Owner

hapiman commented May 3, 2017

ALTER TABLE promote_idfa
add COLUMN impId VARCHAR(255) COMMENT 'impId';

ALTER TABLE promote_idfa
add COLUMN ua VARCHAR(255) COMMENT 'ua';
@hapiman hapiman changed the title sql sql相关语句 May 3, 2017
@hapiman hapiman changed the title sql相关语句 sql相关语句 May 3, 2017
@hapiman
Copy link
Owner Author

hapiman commented May 7, 2017

获取当前时间戳 select unix_timestamp();
获取指定时间的时间戳 select unix_timestamp('2013-01-01 10:10:10');

将时间戳转化成日期 select from_unixtime(1355272360); => 2012-12-12 08:32:40
将时间戳转化成日期,指定格式 select from_unixtime(1355272360,'%Y%m%d');

@hapiman
Copy link
Owner Author

hapiman commented Aug 23, 2017

mysql处理四舍五入 SELECT FORMAT(12332.123456, 4); => 12,332.1235 会直接将数据加上‘,’
如果不需要 则需要 select convert(4545.1366,decimal);这样处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant