mysql> select * from stores; +--------+-------------------+-------+------+------+------------+ | ItemNo | Item | Scode | Qty | Rate | LastBuy | +--------+-------------------+-------+------+------+------------+ | 2001 | Classic HB Pencil | 21 | 60 | 6 | 2009-03-10 | | 2002 | Sharpener | 22 | 55 | 5 | 2009-03-15 | | 2003 | Gel Pen | 21 | 150 | 10 | 2009-03-15 | | 2004 | Fountain Pen | 23 | 4 | 45 | 2009-03-05 | | 2005 | Classic Ball Pen | 22 | 150 | 10 | 2009-03-16 | | 2006 | PB Eraser | 23 | 15 | 5 | 2009-01-05 | | 2007 | Marker | 25 | 18 | 30 | 2009-01-25 | | 2008 | Register | 24 | 20 | 100 | 2009-11-09 | +--------+-------------------+-------+------+------+------------+ 8 rows in set (0.02 sec)
Above is the Table on which I am working, i need the output in the form of :
The price of ITEM is RATE (ITEM = item name), (RATE = rate of that particular item)
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You can try this
SELECT "The price of ", Item," is ", Rate from stores;
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0