묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
xml 퀴리문 문의..
2010.12.21 13:35
SELECT `no` FROM `galaxysystem` WHERE ROUND( SQRT( POW( 0 - `x` , 2 ) + POW( 0 - `y` , 2 ) ) ) >1300 AND no != ( SELECT `galaxyLocation` FROM `mothership`) ORDER BY RAND() LIMIT 1;
도대체 해당 퀴리문을 어떻게 만들어야 할까요.
이중 테이블은 둘째 치더라도..
ROUND, SQRT, POW 어떻게 명명을 해야 하는지 모르겠네요.
<query id="getTest" action="select"> <tables> <table name="galaxysystem" /> </tables> <columns> <column name="*" /> </columns> <conditions> <condition operation="excess" column="ROUND(SQRT(POW(0-'x',2)+POW(0-'y',2)))" var="조건변수명" default="1300" filter="number" pipe="where" /> </conditions> <navigation> <index var="sort_index" order="rand()" /> <list_count var="list_count" default="1" /> </navigation> </query>서브쿼리는 left join을 이용한 후 조건을 null로 하나 더 만드시면 되겠네요.