Home > database >  Oracle to migrate to mysql
Oracle to migrate to mysql

Time:10-18

Mysql how to realize the oracle of the select to_char (sysdate - level 1, "- dd yyyy - mm)" today from dual
Query for seven days

CodePudding user response:

Didn't understand what do you want

CodePudding user response:

reference 1st floor AHUA1001 response:
didn't understand what you want

With mysql implementation (not built table), the effect of the output below
The 2019-10-18
The 2019-10-17
The 2019-10-16
The 2019-10-15
The 2019-10-14
The 2019-10-13
2019-10-12

CodePudding user response:

Version 8.0 after using recursion, version 8.0 before use data dictionary, and oracle before the introduction of connect by similar approach

CodePudding user response:

In mysql to create a table, write 1-10000 in these data, after every time use order, all have to do is to check the table,

CodePudding user response:

reference stelf reply: 3/f
8.0 later use recursion, version 8.0 before use data dictionary, and oracle before the introduction of connect by similar

I tried it on version 8.0 today can have a recursive functionality, thanks

CodePudding user response:

Use recursion, query, I will only achieve a directory tree for a period of time the implementation date

CodePudding user response:

reference stelf reply: 3/f
8.0 later use recursion, version 8.0 before use data dictionary, and oracle before the introduction of connect by similar

Using a recursive tree, I would only realize directory book query, query how to implement a period of time

CodePudding user response:

WITH RECURSIVE cte (p_date, p_num) AS
(SELECT now () as p_date, 1 as p_num
The from dual
UNION ALL
The SELECT DATE_SUB (now (), INTERVAL p_num DAY, p_num + 1
The FROM cte
WHERE p_num & lt; 5)
SELECT * FROM cte.
  • Related