전체 글
-
레코드 중복 그룹출력PHP 2020. 7. 15. 09:44
$result = array(); $result_item = array(); $yangdo_step = 0; $total = count($yangdos); $cnt = 0; foreach ($yangdos as $key) { $cnt++; if($key->yp_yangdo_id != $yangdo_step) { if($yangdo_step) { $result[] = $result_item; } $yangdo_step = $key-> yp_yangdo_id; $result_item = array(); $result_item[ "yangdo_id"] = $key-> yangdo_id; $result_item[ "performanc_type"][] = $key-> performance_type; $result..
-
-
배열 정열하기PHP 2020. 7. 15. 09:43
function array_msort($array, $cols) { $colarr = array(); foreach ($cols as $col => $order) { $colarr[$col] = array(); foreach ($array as $k => $row) { $colarr[$col]['_'.$k] = strtolower($row[$col]); } } $eval = 'array_multisort('; foreach ($cols as $col => $order) { $eval .= '$colarr[\''.$col.'\'],'.$order.','; } $eval = substr($eval,0,-1).');'; eval($eval); $ret = array(); foreach ($colarr as $..
-
검색필드값 조건 걸기MYSQL 2020. 7. 14. 13:44
//검색 필드에서 연산후 별칭을 주어 having 으로 논리연산 ex) SELECT ipc.ipc_name, ipc.ipc_code, eps.eps_m_code, COUNT(epu.epu_idx) AS exam_cnt, SUM(epu.epu_right_cnt + epu.epu_wrong_cnt) AS question_cnt, SUM(epu.epu_right_cnt) AS right_cnt, (SUM(epu.epu_right_cnt) / SUM(epu.epu_right_cnt + epu.epu_wrong_cnt)) * 100 AS rate FROM tb_exam_paper_user AS epu INNER JOIN tb_exam_paper_summery AS eps ON epu.epu_eps_idx = ep..
-
전체값에서 일부값은 몇 퍼센트? 계산법 공식백분율 2020. 7. 14. 13:44
전체값에서 일부값은 몇 퍼센트? 계산법 공식 일부값 ÷ 전체값 X 100 예제) 300에서 105는 몇퍼센트? 답: 35% 전체값의 몇 퍼센트는 얼마? 계산법 공식 전체값 X 퍼센트 ÷ 100 예제) 300의 35퍼센트는 얼마? 답) 105 숫자를 몇 퍼센트 증가시키는 공식 숫자 X (1 + 퍼센트 ÷ 100) 예제) 1548을 66퍼센트 증가하면? 답) 2569.68 숫자를 몇 퍼센트 감소하는 공식 숫자 X (1 - 퍼센트 ÷ 100) 예제) 1548을 66퍼센트 감소하면? 답) 526.32
-