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
운영게시판
최근게시물
MySQL Q&A 27916 게시물 읽기
No. 27916
두개의 쿼리문을 하나로 합치기..
작성자
김동명(gola43)
작성일
2008-12-11 18:57
조회수
5,381

너무 간단한데 제가 너무 오래 쉬었나 봅니다..


SELECT sum(e_count) as cnt_bm from bmgolfexpenses where e_date between '2008-02-01' and '2008-12-11' and e_sort='1' and e_kind != '7' and e_c_id ='2' and substring(e_barcode,3,2) = '00'



SELECT sum(e_count) as cnt_im from imgolfexpenses where e_date between '2008-02-01' and '2008-12-11' and e_sort='1' and e_kind != '7' and e_c_id ='2' and substring(e_barcode,3,2) = '00'



이걸 하나로 합쳐서 출력하고싶습니다....


출력 결과물은요..


-----------------

|cnt_bm |cnt_im |

-----------------

|    12112|  14114|

-----------------


지나가다가 한번 슬쩍 도와주세요...

이 글에 대한 댓글이 총 1건 있습니다.

SELECT

(

SELECT sum(e_count) as cnt_bm from bmgolfexpenses where e_date between '2008-02-01' and '2008-12-11' and e_sort='1' and e_kind != '7' and e_c_id ='2' and substring(e_barcode,3,2) = '00'

) AS cnt_bm,

 

(

SELECT sum(e_count) as cnt_im from imgolfexpenses where e_date between '2008-02-01' and '2008-12-11' and e_sort='1' and e_kind != '7' and e_c_id ='2' and substring(e_barcode,3,2) = '00'

) AS cnt_im

;

우욱님이 2008-12-12 07:16에 작성한 댓글입니다. Edit
[Top]
No.
제목
작성자
작성일
조회
27920sql 작성에 대한 문의 입니다. [3]
2008-12-12
4499
27919특정필드의 값이 한글인지 영문인지...?? [1]
김한수
2008-12-12
4427
27917명령어 질문이에요.. [1]
고릴라
2008-12-11
4101
27916두개의 쿼리문을 하나로 합치기.. [1]
김동명
2008-12-11
5381
2791515만데이터 70개 필드를 3개의 테이블로 분리후 속도문제
김민석
2008-12-10
4215
27914select count관련입니다;; [3]
dd
2008-12-10
4584
27913mysql 호출 [1]
고릴라
2008-12-10
4372
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.025초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다