i have two rows as show in below image.i want to get it as a single column based on aday(TUE) in the table,please any help me how to workout this. thanks in advance

You can't as that would give variable numbers of columns for the rows returned.
You can do a fiddle with GROUP_CONCAT:-
SELECT doctorname, aday, GROUP_CONCAT(CONCAT_WS('~', availfrom, availupto) SEPARATOR '#') avail_time_slots
FROM sometable
GROUP BY doctname, aday
Then in code you would need to split up the avail_time_slots
This question isn't related to java, but rather SQL queries. You could select all in a table, and only return rows where column aday has the value "TUE".
SELECT * FROM table WHERE aday=TUE
SELECT * FROM table WHERE aday=TUE LIMIT 1
LIMIT 1and column is justSELECT aday FROM ...