Вы находитесь на странице: 1из 2

**REGULAR EXPRESSION SUPPORT 1 2 3 4* SQL> select to_char(hire_date,'dd-MON-rr'), first_name,last_name from employees where regexp_like(to_char(hire_date,'MON-dd-rr'),'^JAN') / FIRST_NAME -------------------Douglas Lex Alexander

James Curtis Karen Eleni Peter Janette Mattea Tayler FIRST_NAME -------------------Charles Winston Nandita LAST_NAME ------------------------Grant De Haan Hunold Landry Davies Partners Zlotkey Tucker King Marvins Fox LAST_NAME ------------------------Johnson Taylor Sarchand

TO_CHAR(H --------13-JAN-00 13-JAN-93 03-JAN-90 14-JAN-99 29-JAN-97 05-JAN-97 29-JAN-00 30-JAN-97 30-JAN-96 24-JAN-00 24-JAN-98 TO_CHAR(H --------04-JAN-00 24-JAN-98 27-JAN-96

14 rows selected. --^(Starts with) SQL> ed Wrote file afiedt.buf 1 2 3 4 5* 6 select hire_date, first_name, last_name from employees where regexp_like(to_char(hire_date,'dd-mm-rrrr'),'2000$') / FIRST_NAME -------------------Douglas Steven Hazel Eleni Mattea David Sundar Amit Sundita Charles Girard LAST_NAME ------------------------Grant Markle Philtanker Zlotkey Marvins Lee Ande Banda Kumar Johnson Geoni

HIRE_DATE --------13-JAN-00 08-MAR-00 06-FEB-00 29-JAN-00 24-JAN-00 23-FEB-00 24-MAR-00 21-APR-00 21-APR-00 04-JAN-00 03-FEB-00

11 rows selected. --$(Ends with) **

1 2 3* SQL>

select first_name,last_name from employees where regexp_like(first_name,'^Ste(v|ph)en$') / LAST_NAME ------------------------King Markle Stiles

FIRST_NAME -------------------Steven Steven Stephen 1 2 3* SQL>

select first_name,last_name from employees where regexp_like(first_name,'^Ste(v|ph)en$') / LAST_NAME ------------------------King Markle Stiles

FIRST_NAME -------------------Steven Steven Stephen

. Match any character in the database character set. * Match zero or more occurrences of the preceding subexpression #Display employee where first_name starts with 'J' and followed by 'a' or 'o' an d ends with 'n'. select first_name from employees where regexp_like(first_name,'^J[a|o].*n$'); FIRST_NAME -------------------John Jason John John Jonathon

Вам также может понравиться