Answer the question
In order to leave comments, you need to log in
How to get all data?
Hi everybody!
There is a table:
post (id, name, text, status, sum1, sum2)
I make such a request to calculate the sums of sum1 and sum2. I get the sum_all column and build a query on it.
select *, (sum1 + sum2) AS sum_all from `post` having `sum1` >= 0 and `sum2` <= 90 order by `id` desc
select *, (sum1 + sum2) AS sum_all from `post` where `status` = 1 having `sum1` >= 0 and `sum2` <= 90 order by `id` desc
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question