i have a table like this
product | price | status
--------|--------| ------
pen | 100 | old
pen | 105 | new
--------|--------|-------
Expect result as :-
-----------------
product oldprice newprice
------- -------- ---------
pen 100 105
Please note that the resultset should have column name similar to this.
Can a select query be written to do this?
Because i have to write a similar query like this to fetch the results from another table and finally combine these two results into one ( Like using UNION ALL).
product | price | status
--------|--------| ------
pen | 100 | old
pen | 105 | new
--------|--------|-------
Expect result as :-
-----------------
product oldprice newprice
------- -------- ---------
pen 100 105
Please note that the resultset should have column name similar to this.
Can a select query be written to do this?
Because i have to write a similar query like this to fetch the results from another table and finally combine these two results into one ( Like using UNION ALL).