字符串和日期-SQL语言基础

时间:2024-05-15 13:24:49
【文件属性】:

文件名称:字符串和日期-SQL语言基础

文件大小:5.26MB

文件格式:PPT

更新时间:2024-05-15 13:24:49

SQL 基础

字符串和日期 * SQL> SELECT ename, job, deptno 2 FROM emp 3 WHERE ename = ; 'JAMES' 字符串和日期值应当用单引号括起来. 字符串值大小写敏感,日期值对于日期的格式敏感。 缺省的日期值格式: DD-MON-YY. 例如:23-09-02.为02年9月23日 * SELECT ename, job, deptno FROM emp WHERE ename = 'JAMES'; Character Strings and Dates Character strings and dates in the WHERE clause must be enclosed in single quotation marks (''). Number constants, however, should not. All character searches are case sensitive. In the following example, no rows are returned because the EMP table stores all the data in uppercase: SQL> SELECT ename, empno, job, deptno 2 FROM emp 3 WHERE job='clerk'; Oracle stores dates in an internal numeric format, representing the century, year, month, day, hours, minutes, and seconds. The default date display is DD-MON-YY. Note: Changing default date format will be covered in a subsequent lesson. Number values are not enclosed within quotation marks. Instructor Note Some students may ask how to override the case sensitivity. Later in the course, we will cover the use of single-row functions such as UPPER and LOWER to override the case sensitivity.


网友评论