[Solved] Oracle : YEAR Keyword invalid

Oracle doesn’t have a year() function. You seem to have got that syntax from a different database (like MySQL). You can use the extract() function instead: select * from MIS_PERMAL.MV_INDEX_PERFORMANCE where index_id = 1045 and EXTRACT(YEAR from PRICE_DATE) = 2014 1 solved Oracle : YEAR Keyword invalid

[Solved] What’s the difference between analyzing a table and rebuilding the index in oracle SQL?

A few things to discuss here 1) ANALYZE TABLE COMPUTE STATISTICS; Don’t use this command. It is obsolete. It is designed to collect information on the table to allow queries against it to be run in the best fashion. Use DBMS_STATS.GATHER_TABLE_STATS instead. And that’s just an obvious lead in to that you should have a … Read more

[Solved] How to consolidate overlap date in single

Now that I understand your issue, just subtract the 2 dates to determine the time frame difference: SELECT S.Id, S.Start_dt, S.End_dt, S.Division FROM Sample S JOIN ( SELECT S.Id, Max(S.end_dt-S.start_dt) as timeframe FROM Sample S GROUP BY S.Id ) S2 ON S.Id = S2.Id AND S.end_dt-S.start_dt = s2.timeframe Here is the Fiddle. Good luck. 3 … Read more

[Solved] How to generate view from Monthly data in rows converting it to columns in Oracle tables

The basic pattern you want is to have a case expression for each month, and only show the amount if the monthmatches: select account, day, center, entity, year, frequency, case when month=”Jan” then amount end as jan, case when month=”Feb” then amount end as feb, case when month=”Mar” then amount end as mar, — … … Read more