database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Q&A 40593 게시물 읽기
No. 40593
오라클 테이블 조인 문제 질문드려요^^
작성자
오라초보
작성일
2014-10-22 22:22
조회수
6,699

select t201.name 거래처, t123.name 대분류, t121.code 제품코드, t121.name 제품명, t121.model_no 모델명, t121.bar_code 바코드, t121.stock_cnt 현재고량, t121.std_stock_cnt 적정재고량, t201.code 거래처코드, t121.stock_price 매입가,t121.sale_price 판매단가, t121.standard_in 소박스, standard_out 대박스 from mall_t501_trade_product t501, mall_t121_product t121, mall_t201_company t201, mall_t123_category t123 where t121.company_code = t201.code(+) and t121.large_fraction = t123.large_fraction(+) and t121.eprise_code = t123.eprise_code and t121.end_date > '20141122' and t121.eprise_code = 2 ORDER BY t121.name


위 쿼리가 원래 쿼리입니다.


SELECT substr(trade_date,1,4)||'-'||substr(trade_date,5,2)||'-'||substr(trade_date,7,2) C0000매출일자, t201.name L0000매출처명, t121.name L0000제품명, t121.bar_code C0000바코드, to_char(decode(t500.trade_type,'202',-t501.cnt,t501.cnt),'999,999,999') R0000수량, to_char(t121.stock_price,'999,999,999,999') R0000매입단가, to_char(t501.buying_price,'999,999,999,999') R0000판매단가, to_char(decode(t500.trade_type,'202',-t501.cnt,t501.cnt)*t501.buying_price,'999,999,999,999') R0000합계금액 FROM mall_t201_company t201, mall_t121_product t121, mall_t501_trade_product t501, mall_t500_trade t500 WHERE t500.company_code = t201.code AND t501.product_code = t121.code AND t500.code = t501.trade_code AND t500.trade_type = '200' AND t500.trade_date between '20141022' AND '20141022' and t500.show_yn = 'Y' ORDER BY L0000제품명, C0000바코드, C0000매출일자, L0000매출처명


이게 두번째 쿼리문이에요..


그런데 1번째 쿼리문에 2번째 쿼리문중에 R0000수량과 AND t500.trade_date between '20141022' AND '20141022' 을 넣어서 조인해 보려는데 자꾸 에러만 나네요~~ ㅠㅠㅠ


mall_t501_trade_product t501, mall_t500_trade t500을 같이 조인해야 하는데 테이블을 5개만 조인하면 오라클이 다운되버리네요~~


오라클 초보라 한수 부탁 드려요 ㅠㅠ

[Top]
No.
제목
작성자
작성일
조회
40597쿼리 질문드립니다. [3]
민상기
2014-11-02
6886
40595Por*C PCC-S-02201 에러>Oracle Client Upgrade
김병섭
2014-10-28
6861
40594view 임포트 질문입니다^^
후니
2014-10-25
6708
40593오라클 테이블 조인 문제 질문드려요^^
오라초보
2014-10-22
6699
40592컬럼 타입 varchar2의 25 char과 25 byte 비교 [1]
조형래
2014-10-21
6787
40591오라클 설치시 왜 시스템 파라미터를 지정하는건가요 ?? 왜 ? 기초 질문..
yeon jeong
2014-10-16
6882
40590[질문] 출근 시간 평균을 낼려면 어떻게 해야 할까요? [3]
정규성
2014-10-16
7348
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.020초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다