mysql 퀴리문 질문~

· 2011-09-26 (월) 11:47:42 · 2196 · 2
SELECT
`mto_action_Bidding`.*,
`mto_action_entryList`.`item`,
`mto_action_entryList`.`amount`,
`mto_action_entryList`.`cancelCheck`,
`mto_action_entryList`.`comment`,
MAX(`mto_action_Bidding`.`price`) as 'maxPrice',
`mto_action_entryList`.`endTime`- 1316981797 AS 'leftTime',
(SELECT `name` FROM `mto_user_data` WHERE `id` = `mto_action_entryList`.`id` LIMIT 1) AS 'contributorName'
FROM `mto_action_Bidding` LEFT JOIN `mto_action_entryList` ON `mto_action_Bidding`.`actionKey` = `mto_action_entryList`.`no` WHERE `mto_action_Bidding`.`id` = 'GM00' ORDER BY `mto_action_Bidding`.`no` DESC LIMIT 0, 10


해당 퀴리문이 있습니다.. 위에것 정상 작동 합니다.

문제가 있다면 아무 데이타가 없으면 그냥 반환이 전혀 안되야 하는데.

MAX(`mto_action_Bidding`.`price`) as 'maxPrice', 문구 때문에


no actionKey id insertTime biddingCheck price item amount cancelCheck comment maxPrice leftTime contributorName
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL

이렇게 쓸모 없는 데이터가 날아 옵니다.

MAX(`mto_action_Bidding`.`price`) as 'maxPrice', 문구 넣으면서
저런 데이터 안 나오게 할수 없나요?<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:27:00 MySQL에서 이동 됨]</div>
|

댓글 2개

maxPirce 에서 싱글따옴표가 있군요.
백쿼트(`)로 바꾸거나 아예 없애주시기 바랍니다.
밑에부분들에도 싱글따옴표가 있습니다.
확인해서 없애주거나 백쿼트로 변경해 주십시오.
@mysql_query($query);
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
기타 11-10-10 조회 1,794
기타 11-10-10 조회 1,536
jQuery 11-10-10 조회 2,302
PHP 11-10-08 조회 2,214
Flash 11-10-08 조회 2,386
jQuery 11-10-07 조회 3,210
jQuery 11-10-06 조회 3,626
jQuery 11-10-06 조회 2,058
PHP 11-10-06 조회 4,527
기타 11-10-05 조회 2,381
기타 11-10-05 조회 2,509
Flash 11-10-04 조회 2,021
Flash 11-10-04 조회 6,165
MySQL 11-10-03 조회 2,529
JavaScript 11-10-02 조회 2,292
jQuery 11-10-02 조회 3,672
PHP 11-10-01 조회 1,933
기타 11-09-30 조회 2,053
PHP 11-09-30 조회 2,102
PHP 11-09-29 조회 2,052
JavaScript 11-09-28 조회 1,735
MySQL 11-09-28 조회 2,217
MySQL 11-09-28 조회 4,586
PHP 11-09-26 조회 1,842
MySQL 11-09-26 조회 2,190
MySQL 11-09-26 조회 2,197
MySQL 11-09-25 조회 2,256
JavaScript 11-09-24 조회 2,158
기타 11-09-23 조회 3,781
PHP 11-09-23 조회 1,890