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

function #1

Open
Selflocking opened this issue Oct 17, 2023 · 1 comment
Open

function #1

Selflocking opened this issue Oct 17, 2023 · 1 comment
Assignees
Labels
20分 20分 medium 中等

Comments

@Selflocking
Copy link
Member

Selflocking commented Oct 17, 2023

赛题描述

实现一些常见的函数,包括length、round和date_format。

函数是SQL中常见功能之一。这些函数除了用在查询字段上,还可能会出现在条件语句中,作为查询数据过滤条件之一。

为了简化,仅考虑上述三种函数即可,其中length只考虑char类型,round只考虑float类型,date_format只考虑date类型,遇到其他的数据类型返回FAILURE即可。

赛题地址

https://open.oceanbase.com/train/TopicDetails?questionId=600004&subQesitonId=800016&subQuestionName=function

往年情况

2022年

  1. 实现一些常见的函数:length()、round()、date_format()。
  2. 其中length只考虑char类型,round只考虑float类型,date_format只考虑date类型,遇到其他的数据类型返回FAILURE即可。

测试用例示例:

select length('this is a string') as len;
select length(name) from table;
select round(score, 2) from table;
select date_format(u_date, '%Y-%m-%d') from table;

https://open.oceanbase.com/train/TopicDetails?questionId=500003&subQesitonId=700063&subQuestionName=function

@Selflocking Selflocking added medium 中等 20分 20分 labels Oct 17, 2023
@Days-gone Days-gone self-assigned this Nov 1, 2023
@Selflocking
Copy link
Member Author

IMG_20231106_024859

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

No branches or pull requests

2 participants