Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An introduction to Oracle Database-- filtering and sorting

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Filtering and sorting

SQL >-- query the employees of Department 10

SQL > select *

2 from emp

3 where deptno=10

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 7782 CLARK MANAGER 7839 09-June-81 2450 10 7839 KING PRESIDENT 17-November-81 5000 10 7934 MILLER CLERK 7782 23-January-82 1300 10

SQL >-- string case sensitive

SQL >-- query an employee named KING

SQL > select *

2 from mep

3 /

From mep

*

An error occurred on line 2:

ORA-00942: table or view does not exist

SQL > ed

Written to file afiedt.buf

1 select *

2 from emp

3 * where ename='KING'

SQL > /

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 7839 KING PRESIDENT 17-November-81 5000 10

SQL > ed

Written to file afiedt.buf

1 select *

2 from emp

3 * where ename='King'

SQL > /

No rows selected

SQL >-date format sensitive

SQL >-- query employees whose entry date is 17-11-81

SQL > select *

2 from emp

3 where hiredate='17-November-81'

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 7839 KING PRESIDENT 17-November-81 5000 10

SQL > ed

Written to file afiedt.buf

1 select *

2 from emp

3 * where hiredate='1981-11-17'

SQL > /

Where hiredate='1981-11-17'

*

An error occurred on line 3:

ORA-01861: text does not match format string

SQL >-- modify the date format

SQL > select * from v$nls_parameters

PARAMETER

VALUE

NLS_LANGUAGE

SIMPLIFIED CHINESE

NLS_TERRITORY

CHINA

NLS_CURRENCY

; for

PARAMETER

VALUE

NLS_ISO_CURRENCY

CHINA

NLS_NUMERIC_CHARACTERS

.

NLS_CALENDAR

GREGORIAN

PARAMETER

VALUE

NLS_DATE_FORMAT

DD-MON-RR

NLS_DATE_LANGUAGE

SIMPLIFIED CHINESE

NLS_CHARACTERSET

ZHS16GBK

PARAMETER

VALUE

NLS_SORT

BINARY

NLS_TIME_FORMAT

HH.MI.SSXFF AM

NLS_TIMESTAMP_FORMAT

DD-MON-RR HH.MI.SSXFF AM

PARAMETER

VALUE

NLS_TIME_TZ_FORMAT

HH.MI.SSXFF AM TZR

NLS_TIMESTAMP_TZ_FORMAT

DD-MON-RR HH.MI.SSXFF AM TZR

NLS_DUAL_CURRENCY

; for

PARAMETER

VALUE

NLS_NCHAR_CHARACTERSET

AL16UTF16

NLS_COMP

BINARY

NLS_LENGTH_SEMANTICS

BYTE

PARAMETER

VALUE

NLS_NCHAR_CONV_EXCP

FALSE

19 lines have been selected.

SQL > set linesize 200

SQL > select * from v$nls_parameters

PARAMETER VALUE

NLS_LANGUAGE SIMPLIFIED CHINESE

NLS_TERRITORY CHINA

NLS_CURRENCY

NLS_ISO_CURRENCY CHINA

NLS_NUMERIC_CHARACTERS.

NLS_CALENDAR GREGORIAN

NLS_DATE_FORMAT DD-MON-RR

NLS_DATE_LANGUAGE SIMPLIFIED CHINESE

NLS_CHARACTERSET ZHS16GBK

NLS_SORT BINARY

NLS_TIME_FORMAT HH.MI.SSXFF AM

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report