Here is a paired down version of a query I want to make. How can I get the
grandtotal column? I know about the HAVING clause, but that's only going
to be good for weeding out rows I don't want. I just want to do some basic
math here.
SELECT a.*,
DATE_FORMAT(a.created_on,'%m/%d/%y
To add to this, I will also want to be able to ORDER BY those three new
columns (totalviews, totalclicks, grandtotal) as well.. I'm using mySQL 5
and innodb tables.
I saw this page:
http://dev.mysql.com/doc/refman/5.0/en/user-variables.html
But it says:
Note: In a SELECT statement, each
[snip]
Here is a paired down version of a query I want to make. How can I get
the
grandtotal column? I know about the HAVING clause, but that's only
going
to be good for weeding out rows I don't want. I just want to do some
basic
math here.
SELECT a.*,
DATE_FORMAT(a.created_on,'%m/%d/%y
[snip]
Here is a paired down version of a query I want to make. How can I get
the
grandtotal column? I know about the HAVING clause, but that's only
going
to be good for weeding out rows I don't want. I just want to do some
basic
math here.
[/snip]
More
Okay, well it turns out that this works exactly how I want/expect it to. The
documentation was a bit confusing.
SELECT a.*,
DATE_FORMAT(a.created_on,'%m/%d/%y %h:%i:%s %p') AS
created_on_format,
DATE_FORMAT(a.timestamp,'%m/%d/%y %h:%i:%s %p') AS timestamp_format,