1. 数学函数:
SELECT ABS(column1) AS absolute_value FROM your_table;
2. 字符串函数:
SELECT CONCAT(column1, ' ', column2) AS full_name FROM your_table;
3. 聚合函数:
SELECT AVG(column1) AS average_value FROM your_table;
4. 日期和时间函数:
SELECT CURRENT_TIMESTAMP AS current_time;
5. 逻辑函数:
SELECT CASE WHEN column1 > 100 THEN 'High' ELSE 'Low' END AS priority FROM your_table;
6. 条件函数:
SELECT IFNULL(column1, 'N/A') AS value_or_default FROM your_table;
7. 窗口函数:
SELECT
column1,
ROW_NUMBER() OVER (ORDER BY column2) AS row_num
FROM your_table;
8. 转换函数:
SELECT
column1,
CAST(column2 AS VARCHAR) AS column2_as_string
FROM your_table;
这些是一些常见的函数表达式示例。你可以根据实际需求使用适当的函数,以执行特定的计算、操作或转换。请注意,具体可用的函数可能会因数据库版本而异,建议查阅相关文档以获取准确的信息。
转载请注明出处:http://www.pingtaimeng.com/article/detail/11723/OceanBase