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/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: can we use two 'AND' operator in mysql...................... (/thread-49019.html)



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