11 2022 档案
摘要:group by select DepartmentID from BasicDepartment group by DepartmentID 注意: 在使用group by 时,有一个规则需要遵守,即出现在select列表中的字段,如果没有在组函数中,那么必须出现在group by 子句中。(se
阅读全文
摘要:查重语句 select * from team where teamId in (select teamId from team group by teamId having count(teamId)> 1) select * from team where ID = 2 group by ID
阅读全文
摘要:G_EMPLOYEE_POST select * from ORG_EMPLOYEE_POST as of timestamp to_Date('2021-11-15 13:50:00', 'yyyy-mm-dd hh24:mi:ss')
阅读全文
摘要:alter session set nls_date_format = 'YYYY-MM-DD'; SELECT A.* FROM ORG_DEPT_INFO A LEFT JOIN ORG_INFO B ON A.ORG_ID = B.ID WHERE B.NAME LIKE '%达州%'; SE
阅读全文
摘要:解决办法是,将select得到的结果,再通过中间表select一遍,这样就规避了错误,这个问题只出现于mysql,mssql和oracle不会出现此问题。 MySQL根据字段删除重复值 delete from sites where id not in ( select t.max_id from
阅读全文
摘要:--创建数据库CREATE DATABASE DAY01_TEST01_MARKET; --创建表CREATE TABLE CUSTOMERS( C_NUM INT(11), C_NAME VARCHAR(50), C_CONTACT VARCHAR(50), C_CITY VARCHAR(50),
阅读全文