如果想在emp 內找job為S開頭的資料
query:
SELECT *
FROM emp
WHERE job LIKE 'S%'
這裡的S%代表第一個字是S開頭的
EMPNO | ENAME | JOB | MGR | HIREDATE | SAL | COMM | DEPTNO |
---|---|---|---|---|---|---|---|
7499 | ALLEN | SALESMAN | 7698 | 1981/02/20 | 1600 | 300 | 30 |
7521 | WARD | SALESMAN | 7698 | 1981/02/22 | 1250 | 500 | 30 |
7654 | MARTIN | SALESMAN | 7698 | 1981/09/28 | 1250 | 1400 | 30 |
7844 | TURNER | SALESMAN | 7698 | 1981/09/08 | 1500 | 0 | 30 |
如果想在emp 內找job為GER結尾的資料
query:
SELECT *
FROM emp
WHERE job LIKE '%GER'
EMPNO | ENAME | JOB | MGR | HIREDATE | SAL | COMM | DEPTNO |
---|---|---|---|---|---|---|---|
7698 | BLAKE | MANAGER | 7839 | 1981/05/01 | 2850 | - | 30 |
7782 | CLARK | MANAGER | 7839 | 1981/06/09 | 2450 | - | 10 |
7566 | JONES | MANAGER | 7839 | 1981/04/02 | 2975 | - | 20 |
如果想在emp 內找job內含有S的資料
query:
SELECT *
FROM emp
WHERE job LIKE '%S%'
EMPNO | ENAME | JOB | MGR | HIREDATE | SAL | COMM | DEPTNO |
---|---|---|---|---|---|---|---|
7839 | KING | PRESIDENT | - | 1981/11/17 | 5000 | - | 10 |
7788 | SCOTT | ANALYST | 7566 | 1982/12/09 | 3000 | - | 20 |
7902 | FORD | ANALYST | 7566 | 1981/12/03 | 3000 | - | 20 |
7499 | ALLEN | SALESMAN | 7698 | 1981/02/20 | 1600 | 300 | 30 |
0 Comments:
張貼留言