I have some problems in migrating data from one table to another. Im using a Oracle 11 database. In my problem, one table states some values which are valid in a specific date range (start date and end date). The other table, to which the data should be migrated to, should state these values per month (MMYYY). So for a specific time frame (for example 01/01/2010 to 31/12/2010), the data should be stated per month (01/2010, 02/2010, ..., 31/2010). I was trying to create a suitable sql insert statement for this case but i was not successful in it.
Example:
Table 1 has the following attributes: ID (PK), START_DATE, END_DATE, VALUE
Table 2 has the following attributes: ID (PK), MONTH, YEAR, VALUE
Table 1:
These entries should look like the following in the new table:
Table 2:
Is there a best practice way to do this? Or does anyone have an idea? Thanks for any advice!
使用TO_DATE('mm / yyyy')转换字段,您可以在这里找到更多信息: https : //www.techonthenet.com/oracle/functions/to_date.php
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.