CodeIgniter Forums
can we use two 'AND' operator in mysql...................... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: can we use two 'AND' operator in mysql...................... (/showthread.php?tid=49019)



can we use two 'AND' operator in mysql...................... - El Forum - 02-05-2012

[eluser]noname525[/eluser]
vv


can we use two 'AND' operator in mysql...................... - El Forum - 02-06-2012

[eluser]bgreene[/eluser]
well the query condition is valid ie "where a = b and between x and y" is ok so the fault lies elsewhere


can we use two 'AND' operator in mysql...................... - El Forum - 02-06-2012

[eluser]Aken[/eluser]
Try giving your SUM() function an alias, so it can actually return a column name.
Code:
SELECT SUM(charge) AS total_charges

Also please post in the appropriate forum sections in the future Wink