from, where, like, order by some_column, ASC | DESC, limit

YOUNGJOO-YOON·2021년 12월 16일
0

database

목록 보기
3/5
mysql> select *
    -> from dept_emp
    -> where from_date
    -> like '%-12-%'
    -> order by emp_no DESC
    -> limit 50;
+--------+---------+------------+------------+
| emp_no | dept_no | from_date  | to_date    |
+--------+---------+------------+------------+
| 111133 | d007    | 1986-12-30 | 9999-01-01 |
|  39995 | d004    | 1988-12-04 | 9999-01-01 |
|  39990 | d009    | 1987-12-09 | 9999-01-01 |
|  39986 | d004    | 1998-12-23 | 2000-02-29 |
|  39982 | d004    | 1995-12-10 | 9999-01-01 |
|  39981 | d003    | 1994-12-29 | 9999-01-01 |
|  39948 | d007    | 1986-12-31 | 9999-01-01 |
|  39943 | d002    | 1998-12-21 | 9999-01-01 |
|  39938 | d007    | 1986-12-07 | 9999-01-01 |
|  39934 | d009    | 1992-12-25 | 1998-05-25 |
|  39923 | d004    | 1998-12-20 | 9999-01-01 |
|  39916 | d005    | 1993-12-30 | 9999-01-01 |
|  39914 | d005    | 1991-12-02 | 1997-04-29 |
|  39911 | d008    | 1989-12-03 | 9999-01-01 |
|  39901 | d004    | 1985-12-03 | 9999-01-01 |
|  39893 | d005    | 1988-12-28 | 9999-01-01 |
|  39890 | d007    | 1986-12-07 | 9999-01-01 |
|  39888 | d004    | 1995-12-10 | 9999-01-01 |
|  39887 | d006    | 1993-12-09 | 1996-06-18 |
|  39885 | d006    | 1994-12-30 | 9999-01-01 |
|  39877 | d004    | 2000-12-08 | 9999-01-01 |
|  39796 | d004    | 1993-12-09 | 9999-01-01 |
|  39776 | d008    | 1989-12-13 | 9999-01-01 |
|  39758 | d005    | 1990-12-03 | 1998-07-04 |
|  39698 | d006    | 1988-12-05 | 1989-06-10 |
|  39698 | d004    | 1985-12-27 | 1988-12-05 |
|  39680 | d007    | 1990-12-01 | 9999-01-01 |
|  39676 | d005    | 1992-12-31 | 2000-08-19 |
|  39675 | d004    | 1994-12-13 | 9999-01-01 |
|  39660 | d007    | 1996-12-20 | 9999-01-01 |
|  39631 | d007    | 1985-12-10 | 9999-01-01 |
|  39624 | d009    | 1997-12-23 | 9999-01-01 |
|  39614 | d009    | 1993-12-08 | 1994-11-19 |
|  39613 | d004    | 1991-12-18 | 1999-10-02 |
|  39587 | d005    | 1985-12-22 | 9999-01-01 |
|  39573 | d007    | 1989-12-15 | 9999-01-01 |
|  39550 | d001    | 1999-12-21 | 9999-01-01 |
|  39548 | d008    | 2001-12-07 | 9999-01-01 |
|  39538 | d003    | 2000-12-10 | 9999-01-01 |
|  39523 | d004    | 1993-12-15 | 9999-01-01 |
|  39505 | d005    | 1994-12-21 | 9999-01-01 |
|  39491 | d009    | 1988-12-16 | 1996-03-17 |
|  39481 | d005    | 1993-12-28 | 2002-02-24 |
|  39472 | d009    | 1996-12-21 | 1997-04-17 |
|  39464 | d005    | 1999-12-19 | 9999-01-01 |
|  39453 | d001    | 1996-12-17 | 9999-01-01 |
|  39449 | d002    | 1988-12-15 | 9999-01-01 |
|  39433 | d009    | 1990-12-06 | 9999-01-01 |
|  39428 | d004    | 1989-12-15 | 1998-05-13 |
|  39415 | d003    | 1999-12-13 | 2002-03-16 |
+--------+---------+------------+------------+
profile
이 블로그의 글은 제 생각을 정리한 글과 인터넷 어딘가에서 배운 것을 정리한 글입니다. 출처는 되도록 남기도록 하겠습니다. 수정 및 건의 오류 등이 있으면 언제든지 댓글 부탁드립니다.

0개의 댓글