일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- JavaScript
- 리눅스
- 인라인뷰
- 백틱
- post방식
- 명령어
- JS
- Ajax
- 동적
- MySQL
- oracle
- option태그
- DATE_FORMAT
- 동적테이블
- 프로그래머스
- 컨트롤러
- 코테
- Update
- JSP
- like
- 자바스크립트
- SQL
- 변수
- 도커
- 테이블
- 배열
- Spring
- 함수
- order by
- select
- Today
- Total
목록Deveolpment Study🗂️/Databases (37)
bom's happy life
전달받은 DAO파일에 selectByPk가 무엇인지 찾다가 알게된 것. 원래 DAO를 통해 xml로 가야하는데 어디로 가야하는지 몰랐다. 알고보니 전에 myBatis를 쓸 때 selectOne 이 selectByPk였다. iBatis를 -> myBatis로 selectByPk -> selectOne list -> selectList 1. selectOne( ) : 쿼리 결과가 없으면 null을 반환 - select문의 실행결과가 1개일때. - 하나의 데이터를 검색하는 SQL구문을 실행할 때 사용 - 쿼리 결과로 레코드가 하나만 나와야 한다 -> 다수의 레코드가 있을 시 TooManyResultsException 에러 발생 2. selectList ( ) : 쿼리 결과를 List로 반환 - 하나 이상의 데..
select *, (select center_name from t_member WHERE t_product.member_id = t_member.member_id) as center_name from t_product where member_id=#{member_id} order by product_entered_date desc
# 기존 테이블 정보를 이용해서 새로운 테이블 정의하기 SELECT dno, dname FROM dept; CREATE TABLE test_dept as select dno, dname from dept; select * from dept; select * from test_dept; . . . -- 검색하기 select * from dept; -- 전체 복사 create table abcd as select * from dept; -- 이건 모든 내용을 복제한것 -- 구조만 복사 create table abcd as select * from dept where 0=1; select * from abcd; . . . # 뷰 만들기 create view dept_view as select * from de..
원하는 데이터를 가져와주는 기본적인 . . SELECT 열이름 FROM 테이블이름 WHERE 조건 --SELECT 구문 형식 . . USE 구문(db선택) -사용할 DB를 지정하는 구문 -다른 DB를 사용하겠다 명시하지 않으면 같은 DB사용 -HeidiSQL에서는 클릭으로 해결! USE 데이터베이스이름; . . SELECT와 FROM 사용 - FROM 뒤에 오는 DB이름.테이블 이름 - 보통 USE DB를 먼저 사용하므로 아래의 두 구문은 같음 . . 해당 테이블에서 원하는 열 가져오기 -여러 개의 열을 가져올 때는 콤마로 구분 -순서는 사용자가 원하는 대로 지정 SELECT memberName, memberID, memberAddress FROM memberTBL; . . 별칭 AS -열 이름을 다르게..