Doris与mysql语法对照,差异篇
2022/1/6 19:35:10
本文主要是介绍Doris与mysql语法对照,差异篇,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
## SQL语法差异: ### doris中不支持分组列再使用distinct MSYQL: ```SQL select DISTINCT mid from order_card_detail GROUP BY mid ``` DORIS: ```SQL select mid from order_card_detail GROUP BY mid ``` doris执行异常:[Err] 1064 - errCode = 2, detailMessage = cannot combine SELECT DISTINCT with aggregate functions or GROUP BY ### mysql中 where后可直接 locate() 判断,doris中需判断 MYSQL: ```sql select mid from order_card_detail where LOCATE(mid,'4') ``` DORIS: ```SQL select mid from order_card_detail where LOCATE(mid,'4')>0 ``` doris执行异常:[Err] 1064 - errCode = 2, detailMessage = WHERE clause requires return type 'BOOLEAN'. Actual type is 'INT'. ### doris 中编写sql不支持 #注释 MYSQL: ```SQL #1233 select * from hopsonone_point.members_points_detail limit 100 ``` DORIS: ```sql --1233 select * from hopsonone_point.members_points_detail limit 100 ``` doris执行异常:[Err] 1064 - errCode = 2, detailMessage = Please check your sql, we meet an error when parsing. ### mysql中支持部分多表联查分组后跟部分字段,doris需将非聚合查询字段都放在分组条件后 MYSQL: ```SQL SELECT m_id,behavior,SUM(point) FROM ( select m_id,behavior,point from hopsonone_point.members_points_detail limit 100 ) t1 GROUP BY m_id; ``` DORIS: ```sql SELECT m_id,behavior,SUM(point) FROM ( select m_id,behavior,point from hopsonone_point.members_points_detail limit 100 ) t1 GROUP BY m_id,behavior; ``` doris执行异常:[Err] 1064 - errCode = 2, detailMessage = select list expression not produced by aggregation output (missing from GROUP BY clause?): `behavior`
这篇关于Doris与mysql语法对照,差异篇的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-07MySQL读写分离入门:轻松掌握数据库读写分离技术
- 2024-12-07MySQL读写分离入门教程
- 2024-12-07MySQL分库分表入门详解
- 2024-12-07MySQL分库分表入门指南
- 2024-12-07MySQL慢查询入门:快速掌握性能优化技巧
- 2024-12-07MySQL入门:新手必读的简单教程
- 2024-12-07MySQL入门:从零开始学习MySQL数据库
- 2024-12-07MySQL索引入门:新手快速掌握MySQL索引技巧
- 2024-12-06BinLog学习:MySQL数据库BinLog入门教程
- 2024-12-06Binlog学习:MySQL数据库的日志管理入门教程