<?
$qry = "SELECT op_pcode,sum(op_cnt) as cnt
FROM view_order where paystatus = 'Y'
and canceled = 'N'
and ifnull(isNow,'N') = 'Y'
group by op_pcode
order by cnt desc limit 10";
$qry = "SELECT op_pcode,sum(op_cnt) as cnt
FROM view_order where paystatus = 'Y'
and canceled = 'N'
and ifnull(isNow,'N') = 'Y'
group by op_pcode
order by cnt desc limit 10";
$rlt = mysql_query($qry);
while($row = mysql_fetch_array($rlt)) {
$pcode = $row['op_pcode'];
$pcnt = $row['cnt'];
//상품명
$prslt = mysql_fetch_array(mysql_query("select name,cateCode,price_org,price,saleCnt from odtProduct where code='".$pcode."'"));
$pname = $prslt[name];
$price_org = $prslt[price_org];
$price = $prslt[price];
$pcatecode = $prslt[cateCode];
$psalecnt = $prslt[saleCnt];
$prslt = mysql_fetch_array(mysql_query("select name,cateCode,price_org,price,saleCnt from odtProduct where code='".$pcode."'"));
$pname = $prslt[name];
$price_org = $prslt[price_org];
$price = $prslt[price];
$pcatecode = $prslt[cateCode];
$psalecnt = $prslt[saleCnt];
//카레고리명
$pcatename = mysql_result(mysql_query("select catename from odtCategory where catecode='".$pcatecode."'"),0);
$pcatename = mysql_result(mysql_query("select catename from odtCategory where catecode='".$pcatecode."'"),0);
?>
이것들이 다 무슨 말이지요?? 저는 디비 안에 있는 [saleCnt] 라는 디비값만 가져오고 싶은데...
저 위의 구문이 해석이 안되니 힘드네요 ..
빨간색 구문은 특히 이해가 안갑니다 무슨 설정 값인지..
아래부분은 대충 이해는 했습니다만 ㅠㅠ
해석해주실 능력자분 계신가요?
댓글 3개
13년 전
자유게시판에서 게시물 이동됩니다.
13년 전
SELECT 검색해라
op_pcode,sum(op_cnt) as cnt 를
FROM view_order 이테이블에서
where paystatus = 'Y'
and canceled = 'N'
and ifnull(isNow,'N') = 'Y'
조건은 지불상태가y이면서 취소하지 않은것을 그리고 isnow 상태가 비어있다면 n으로 바꿔라 그 isnow 가 y 인조건으로
group by op_pcode
그결과를 op_pcode 로 묵어라
order by cnt desc
소팅하라 cnt가 높은순으로
limit 10
그중 10개만 출력하라 정도 되겠습니다
op_pcode,sum(op_cnt) as cnt 를
FROM view_order 이테이블에서
where paystatus = 'Y'
and canceled = 'N'
and ifnull(isNow,'N') = 'Y'
조건은 지불상태가y이면서 취소하지 않은것을 그리고 isnow 상태가 비어있다면 n으로 바꿔라 그 isnow 가 y 인조건으로
group by op_pcode
그결과를 op_pcode 로 묵어라
order by cnt desc
소팅하라 cnt가 높은순으로
limit 10
그중 10개만 출력하라 정도 되겠습니다
13년 전
정말 감사합니다!!! 많은 도움이 되었어요!! ㅠㅠ
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 330 |
prosper
|
20년 전 | 2240 | |
| 329 |
prosper
|
20년 전 | 1849 | |
| 328 |
prosper
|
20년 전 | 1660 | |
| 327 | 20년 전 | 3738 | ||
| 326 | 20년 전 | 4816 | ||
| 325 |
hwatta
|
20년 전 | 2435 | |
| 324 |
|
20년 전 | 3117 | |
| 323 | 20년 전 | 5822 | ||
| 322 |
hwatta
|
20년 전 | 2813 | |
| 321 |
hwatta
|
20년 전 | 2292 | |
| 320 |
yesmoa
|
20년 전 | 4547 | |
| 319 | 20년 전 | 2645 | ||
| 318 | 20년 전 | 2222 | ||
| 317 |
kyodon
|
20년 전 | 2749 | |
| 316 | 20년 전 | 2550 | ||
| 315 |
|
20년 전 | 2866 | |
| 314 |
|
20년 전 | 3307 | |
| 313 |
|
20년 전 | 2622 | |
| 312 |
yesmoa
|
20년 전 | 4695 | |
| 311 | 20년 전 | 3224 | ||
| 310 |
홀로남은자
|
20년 전 | 4532 | |
| 309 | 20년 전 | 2987 | ||
| 308 | 20년 전 | 4105 | ||
| 307 | 20년 전 | 4339 | ||
| 306 | 20년 전 | 7008 | ||
| 305 | 20년 전 | 3841 | ||
| 304 | 20년 전 | 2741 | ||
| 303 |
크리스탈처럼
|
20년 전 | 4374 | |
| 302 | 20년 전 | 2187 | ||
| 301 |
|
20년 전 | 4309 | |
| 300 | 20년 전 | 3764 | ||
| 299 | 20년 전 | 2561 | ||
| 298 | 20년 전 | 4791 | ||
| 297 |
|
20년 전 | 2504 | |
| 296 | 20년 전 | 4496 | ||
| 295 | 20년 전 | 3549 | ||
| 294 | 20년 전 | 3568 | ||
| 293 | 20년 전 | 3802 | ||
| 292 | 20년 전 | 3183 | ||
| 291 |
yesmoa
|
20년 전 | 5897 | |
| 290 | 20년 전 | 2919 | ||
| 289 | 20년 전 | 5825 | ||
| 288 |
|
20년 전 | 2348 | |
| 287 |
|
20년 전 | 1754 | |
| 286 |
|
20년 전 | 2124 | |
| 285 |
|
20년 전 | 3510 | |
| 284 |
|
20년 전 | 2015 | |
| 283 |
|
20년 전 | 4381 | |
| 282 | 20년 전 | 3360 | ||
| 281 |
|
20년 전 | 2187 | |
| 280 |
|
20년 전 | 7782 | |
| 279 | 20년 전 | 5522 | ||
| 278 | 20년 전 | 2970 | ||
| 277 |
|
20년 전 | 5551 | |
| 276 | 20년 전 | 2339 | ||
| 275 | 20년 전 | 2572 | ||
| 274 | 20년 전 | 2339 | ||
| 273 | 20년 전 | 2188 | ||
| 272 | 20년 전 | 2111 | ||
| 271 | 20년 전 | 2578 | ||
| 270 | 20년 전 | 2561 | ||
| 269 | 20년 전 | 2445 | ||
| 268 | 20년 전 | 2659 | ||
| 267 | 20년 전 | 2346 | ||
| 266 | 20년 전 | 2549 | ||
| 265 | 20년 전 | 3482 | ||
| 264 |
|
20년 전 | 5336 | |
| 263 |
|
20년 전 | 3696 | |
| 262 | 20년 전 | 3149 | ||
| 261 |
허저비
|
20년 전 | 5906 | |
| 260 |
|
20년 전 | 5698 | |
| 259 | 20년 전 | 4115 | ||
| 258 | 20년 전 | 2365 | ||
| 257 | 20년 전 | 3164 | ||
| 256 | 20년 전 | 1882 | ||
| 255 | 20년 전 | 1547 | ||
| 254 | 20년 전 | 3122 | ||
| 253 | 20년 전 | 3533 | ||
| 252 | 20년 전 | 5082 | ||
| 251 | 20년 전 | 5790 | ||
| 250 | 20년 전 | 3653 | ||
| 249 | 20년 전 | 4990 | ||
| 248 | 20년 전 | 3271 | ||
| 247 | 20년 전 | 3615 | ||
| 246 |
|
20년 전 | 7922 | |
| 245 |
|
20년 전 | 5886 | |
| 244 | 20년 전 | 4467 | ||
| 243 |
|
20년 전 | 4018 | |
| 242 | 20년 전 | 2749 | ||
| 241 | 20년 전 | 2690 | ||
| 240 | 20년 전 | 2323 | ||
| 239 | 20년 전 | 1623 | ||
| 238 |
아우겐나이스
|
20년 전 | 2237 | |
| 237 |
email
|
20년 전 | 3659 | |
| 236 | 20년 전 | 4120 | ||
| 235 | 20년 전 | 10440 | ||
| 234 | 20년 전 | 5038 | ||
| 233 | 20년 전 | 3353 | ||
| 232 | 20년 전 | 3173 | ||
| 231 | 20년 전 | 3806 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기