Home > database >  Oracle can realize dynamic field names
Oracle can realize dynamic field names

Time:09-24

Such as I have a list of data to use date for column names, but requires date format is' on XXX XXX, requires every date as the change of the day, so the column name is' '| |' month '| |' | ', to such a dynamic implementation

CodePudding user response:

Are you trying to query, the column name, or modify the column name from the list of defined?

CodePudding user response:

Is to create a table, or just select out view

CodePudding user response:

Usually there is no such a design, the date should be only one field, the field data save each day, and then through the ranks of conversion query for column names is a date,

CodePudding user response:

Based on the monthly units, is a year for the unit? 365 days, 365 fields? This is not a good way

CodePudding user response:

Is the column name, such as today is March 1, the column name is March 1, column names tomorrow is March 2

CodePudding user response:

Dynamic SQL stitching

CodePudding user response:

With the view...

CodePudding user response:

refer to 6th floor acen_chen response:
dynamic SQL splicing


Can probably tell me about it

CodePudding user response:

refer to 7th floor weixin_38847048 response:
with a view...
,


How to use
  • Related