How do you merge these two rows?
"SELECT col1, col2, col3, col4 FROM table_a WHERE col4 = '$col4_val'"
and
"SELECT col1 FROM table_a WHERE col5 = '$col4_val'"
say the first query col1 = 20 and the second query col1 = 10
how do I create a query that returns the values of col1,col2,col3,col4 from the first query but col1 = 30 (first and second query added together)?
I can do the arithmetic via php but I would prefer to do it in the query if possible.