SQL
Posted: Tue Aug 13, 2002 11:45 pm
my coding is
for($count_sql1=$count_load;$count_sql1<$count_load_limit;$count_sql1++) {
$count_bag_pieces=mysql_query("SELECT
sum(pas_dep_bg_pcs) as pcs,sum(pas_rtn_bg_pcs) as pcs_r,pas_dep_flight,pas_rtn_flight
FROM pase_res
WHERE (pas_dep_flight='$flight_list_no' and pas_dep_status='B' and pas_dep_board_seq ='$count_sql1' ) or ( pas_rtn_flight='$flight_list_no'and pas_rtn_status='B' and pas_rtn_board_seq='$count_sql1')")or die(mysql_error());
while($pi=mysql_fetch_array( $count_bag_pieces))
{
$depart_flight_load=$pi['pas_dep_flight'];
$depart_Peices_load=$pi['pcs'];
########
$return_flight_load=$pi['pas_rtn_flight'];
$return_piece_load=$pi['pcs_r'];
//$p_bag=$pi['pcs'];
} }
error is
Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause
what 's wrong
for($count_sql1=$count_load;$count_sql1<$count_load_limit;$count_sql1++) {
$count_bag_pieces=mysql_query("SELECT
sum(pas_dep_bg_pcs) as pcs,sum(pas_rtn_bg_pcs) as pcs_r,pas_dep_flight,pas_rtn_flight
FROM pase_res
WHERE (pas_dep_flight='$flight_list_no' and pas_dep_status='B' and pas_dep_board_seq ='$count_sql1' ) or ( pas_rtn_flight='$flight_list_no'and pas_rtn_status='B' and pas_rtn_board_seq='$count_sql1')")or die(mysql_error());
while($pi=mysql_fetch_array( $count_bag_pieces))
{
$depart_flight_load=$pi['pas_dep_flight'];
$depart_Peices_load=$pi['pcs'];
########
$return_flight_load=$pi['pas_rtn_flight'];
$return_piece_load=$pi['pcs_r'];
//$p_bag=$pi['pcs'];
} }
error is
Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause
what 's wrong