SELECT to_char(SWL_DATE,'YYYY-mm-DD') SWL_DATE, WL FROM (SELECT TRUNC(S.SWL_DATE) SWL_DATE, ROUND(AVG(S.WL),2) WL FROM HYDROLOGY.SWL_DATA S WHERE TRUNC(SWL_DATE)>=sysdate-30 and TRUNC(SWL_DATE)<=sysdate and STATION_ID='SW89' and WL IS NOT NULL 
GROUP BY S.STATION_ID, TRUNC(S.SWL_DATE))
ORDER BY SWL_DATE DESC

SELECT * FROM SWL_DATA WHERE SWL_DATE ORDER BY SWL_DATE DESC

SELECT sw.STATION_NAME,sw.STATION_ID,sa.EC_HIGHTIDE,sa.EC_LOWTIDE,sa.SLNT_DATE 
FROM SW_STATION_TBL sw JOIN SALINITY_DATA sa ON sw.STATION_ID=sa.STATION_ID
WHERE sw.STATION_ID='SW184' AND sa.EC_HIGHTIDE is not null AND TRUNC(sa.SLNT_DATE)>=sysdate-360 and TRUNC(sa.SLNT_DATE)<=sysdate