数据库2025年06月26日
一、MySQL使用limit分页 select * from table_name limit m, n; // m = (startPage-)*pageSize, n = pageSize 注:m是MySQL中数据行的起始下标,它从0开始 二、Oracle使用rownum分页 select * from ( select rownum rn, a.* ...
数据库2025年06月26日
Oracle和mysql的一些简单命令对比 1) SQL> select to_char(sysdate,'yyyy-mm-dd') from dual; SQL> select to_char(sysdate,'hh24-mi-ss') from dual; mysql> select date_format(n...
数据库2025年06月26日
1.先将文件导入到容器 docker cp **.sql 【容器名】:/root/ 2.进入容器 docker exec -ti 【容器名/ID】/bin/bash 3.将文件导入数据库 mysql -uroot -proot 【数据库名】 < ***.sql 也可切换数据库使用source命令 ...
数据库2025年06月25日
有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲。 错误提示: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use n...
数据库2025年06月25日
/* --以下代码是对emp表进行显示宽度设置 col empno for 9999; col ename for a10; col job for a10; col mgr for 9999; col hiredate for a12; col sal for 9999; col comm for 9999; col deptno for 99; set...
数据库2025年06月25日
--1、查看表空间的名称及大小 SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_name = d.tablespace_name GROUP B...
数据库2025年06月24日
1 直接上语法 2 select * from users where id=8E0union select ,,,,,,,,, 3 select * from users where id=.0union select ,,,,,,,,, 4 select * from users where id=\Nunion select ,,,,,,,,, 5 ...
数据库2025年06月24日
Sql Server、Mysql、Oracle三者之间的区别与联系 相同点: 三者都关系型数据库 Sql server Mysql Orcle 诞生早、结构严谨、高可用性、高性能 开源、简单易用 高度集成化 价格便宜、安装简便快捷、可通过修改代码来实现定向优化 主要应用在传统业务中,例如:银行、金融这样对可用性、健壮性、安全性、实时性 要求极高的业务 对于...
数据库2025年06月24日
1、应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描。 2、对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 3、应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: sele...
数据库2025年06月23日
...