묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
XML 쿼리 관련. 조인 문제입니다.
2009.02.23 22:31
<query id="getCommunityLists" action="select">
<tables>
<table name="wdr_community_member" alias="member" />
<table name="wdr_community" alias="comm" />
</tables>
<columns>
<column name="comm.name" />
</columns>
<conditions>
<condition operation="equal" column="member.url" default="comm.url" />
<condition operation="equal" column="member.user_id" var="s_user_id" pipe="and" />
</conditions>
<navigation>
</navigation>
</query>
다음과 같이 XML로 조인을 구성하였을 때, 메인 페이지에 쿼리를 뿌려보면
select comm.name from `wdr_community_member` as member,`wdr_community` as comm
where (member.url = 'comm.url' and member.user_id = 'admin')
이처럼 조인해야할 테이블 이름에 '' 마크가 쳐져서 문자열로 인식해버리는 이유로 데이터가 나오질 않습니다.
prefix는 function에 옵션을 살짝 추가해서 변수에 따라 떼어낼 수 있게 약간 변경하였습니다.
var는 ID값 하나만 넣었구요.
혹시 조인을 위해서 더 해줘야 할 일이 있나요??
<tables>
<table name="wdr_community_member" alias="member" />
<table name="wdr_community" alias="comm" />
</tables>
<columns>
<column name="comm.name" />
</columns>
<conditions>
<condition operation="equal" column="member.url" default="comm.url" />
<condition operation="equal" column="member.user_id" var="s_user_id" pipe="and" />
</conditions>
<navigation>
</navigation>
</query>
다음과 같이 XML로 조인을 구성하였을 때, 메인 페이지에 쿼리를 뿌려보면
select comm.name from `wdr_community_member` as member,`wdr_community` as comm
where (member.url = 'comm.url' and member.user_id = 'admin')
이처럼 조인해야할 테이블 이름에 '' 마크가 쳐져서 문자열로 인식해버리는 이유로 데이터가 나오질 않습니다.
prefix는 function에 옵션을 살짝 추가해서 변수에 따라 떼어낼 수 있게 약간 변경하였습니다.
var는 ID값 하나만 넣었구요.
혹시 조인을 위해서 더 해줘야 할 일이 있나요??
댓글 3
-
라르게덴
2009.02.23 23:04
-
우준희806
2009.02.24 00:00
글 보고 방금 시도해봤습니다 :)
안되네요.... ㅠㅠ; -
라르게덴
2009.02.24 01:43
<query id="getNewestDocuments" action="select">
<tables>
<table name="documents" alias="documents" />
<table name="document_categories" alias="categories" />
</tables>
<columns>
<column name="documents.*" />
<column name="categories.title" alias="categories_title" />
</columns>
<conditions>
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
<condition operation="equal" column="documents.category_srl" default="categories.category_srl" notnull="notnull" pipe="and" />
<condition operation="equal" column="documents.is_notice" var="notice_type" pipe="and" />
<condition operation="equal" column="documents.document_srl" var="document_id" pipe="and" />
<condition operation="notin" column="documents.category_srl" var="category_id" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="documents.list_order" order="order_type" />
<list_count var="list_count" default="20" />
</navigation>
</query>
간단한 조인입니다.
위 조인으로 정상적으로 수행 되었으니 참고하세요.
글쓴이 | 제목 | 최종 글 |
---|---|---|
XE | 공지 글 쓰기,삭제 운영방식 변경 공지 [16] | 2019.03.05 by 남기남 |
romper | 이런 에러메시지가 계속 뜨네요. 도움 부탁드립니다. [2] | 2011.04.29 by romper |
쿵푸팬더 | 이미지 포함안할시 기본 이미지 자동 첨부되도록 하는 방법? [2] | 2011.04.29 by 송동우 |
비누거품 | 게시판을 이런 형태로 만들수 있을까요? [1] | 2011.04.29 by 송동우 |
foranie | XE의 페이지 기능 | |
준회원준회원 | 질문이요. [1] | 2011.04.29 by 송동우 |
준회원준회원 | 안녕하세요. [1] | 2011.04.29 by 송동우 |
LUCASLEE | 몇가지 질문 드립니다 [2] | 2011.04.29 by 송동우 |
레이머스 | 게시판에서의 날짜 계산법 | |
쿵푸팬더 | http://shop.xpressengine.net/ 에서 사용하는 스킨 이름이 알고 싶습니다!! [1] | 2011.04.29 by 송동우 |
인생힘들어 | 제로보드관련질문은 아니지만 급합니다 도와주세요 | |
장노 | db를 백업해서 호스팅에서 Import했는데 에러 발생.. [1] | 2011.04.29 by 송동우 |
쿵푸팬더 | 최근글 위젯사용시 하단에 번호 추가할 수 없을까요? | |
날자고도 | 레이아웃 수정후 자동이미지 리사이즈가 안될때 | |
하유_ | 게시판 다운로드 영역 삭제방법 [1] | 2011.04.29 by 송동우 |
허접Zero | 위젯 관련 질문입니다 [1] | 2011.04.29 by 송동우 |
dus2000.myid.net | 레이아웃 메뉴에서 bullet 색을 항목마다 다르게 [3] | 2011.04.29 by dus2000.myid.net |
또별 | IE8 브라우저에서 자동으로 호환성보기 모드 문의합니다. [2] | 2011.04.29 by 전승남508 |
데오필로 | 1.4.4.4에서 1.4.5.5로 업데이트후 레이아웃 깨짐 | |
원동용305 | 스킨질문입니다 [1] | 2011.04.28 by 송동우 |
마일드^^ | xe_module_config 의 syndication 관련 파라미터값 알려주실분 ㅠㅠ [1] | 2011.04.28 by redred |
수로 인식 시키면 없어질 것 같은데요.