자바.. 다형성
데베
insert into emp(empno, ename, job, mgr, hiredate, sal, comm,deptno) values(1000,'김승석','사원',7000,'21-09-27',2000,null,10);
insert into emp(empno, ename, job, mgr, hiredate, sal, comm,deptno) values(1001,'박천수','대리',7001,'21-09-01',2500,null,10);
insert into emp(empno, ename, job, mgr, hiredate, sal, comm,deptno) values(2000,'김동현','사원',7002,'21-09-02',3000,null,20);
insert into emp(empno, ename, job, mgr, hiredate, sal, comm,deptno) values(2001,'서용식','주임',7003,'21-09-03',3500,null,20);
insert into emp(empno, ename, job, mgr, hiredate, sal, comm,deptno) values(3000,'박종윤','과장',7004,'21-09-07',4000,300,30);
insert into emp(empno, ename, job, mgr, hiredate, sal, comm,deptno) values(3001,'박오균','사원',7005,'21-09-06',4500,null,30);
insert into emp(empno, ename, job, mgr, hiredate, sal, comm,deptno) values(4000,'박도성','과장',7006,'21-09-07',5000,500,40);
insert into emp(empno, ename, job, mgr, hiredate, sal, comm,deptno) values(4001,'김장미','사원',7007,'21-09-08',5500,null,40);
도스에선 널이 안보이므로 ""안에 있는 텍스트로 채울 수 있음
SET NULL " "
select ename, comm, sal*12+comm wholesal from emp;
select ename, comm, sal*12+comm wholesal# from emp;
대소문자 구분 안됨, 다 대문자
별칭 안쓰면 그냥 sal*12+comm
으로 된다.
select ename, comm, sal*12+comm "Whole_sal #" from emp;
select ename, comm, sal*12+comm as WholeSal# from emp;
as 뒤에 쓰기
select ename, 'is a', job from emp;
열추가
select ename || 'is a' || job from emp;
중복되는 값을 제외하고 보여준다.
select distinct deptno from emp
select distinct deptno from emp
order by deptno;