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
SQL
Moderator: General Moderators
-
prasadharischandra
- Forum Commoner
- Posts: 57
- Joined: Thu May 09, 2002 2:19 am
- Location: sri lanka
- Contact:
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Re: SQL
Well the error message does kinda tell you - and 9902468 pointed it out too - you don't have a GROUP BY clause.prasadharischandra wrote:Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause
what 's wrong
Read up on this:
http://www.mysql.com/doc/en/SELECT.html
and
http://www.mysql.com/doc/en/Group_by_functions.html
The manual is your friend...
Mac
-
prasadharischandra
- Forum Commoner
- Posts: 57
- Joined: Thu May 09, 2002 2:19 am
- Location: sri lanka
- Contact:
Re: SQL
hai mac,
i did it using two querys but it's not a good way .
write to me if u have like that problem how u are solving.
i highly appriciated u;re helping
i did it using two querys but it's not a good way .
write to me if u have like that problem how u are solving.
i highly appriciated u;re helping