-1
我有PostgreSQL中的表具有以下的列如何复制表列
date count day
_____ ______ _____
2015-04-01 10 1
2015-04-02 30 1
2015-04-03 90 1
2015-04-04 10 1
2015-04-05 80 1
2015-04-06 90 1
我想这个表是为2-30天。(生成数随机数在10和100之间) 。如何复制在PostgreSQL.Any帮助日系理解
date count day
_____ ______ _____
2015-04-01 10 1
2015-04-02 30 1
2015-04-03 90 1
2015-04-04 10 1
2015-04-05 80 1
2015-04-06 90 1
2015-04-01 10 2
2015-04-02 40 2
2015-04-03 90 2
2015-04-04 10 2
2015-04-05 80 2
2015-04-06 80 2
2015-04-01 60 3
2015-04-02 30 3
2015-04-03 60 3
2015-04-04 20 3
2015-04-05 80 3
2015-04-06 90 3
你应该在提问之前进行搜索。这不是一个为我工作的网站。快速搜索产生了这些...循环语句:http://www.postgresqltutorial.com/plpgsql-loop-statements/日期计算:https://www.postgresql.org/docs/9.1/static/functions-datetime。 html随机数:https://www.techonthenet.com/postgresql/functions/random.php或者,如果这些对您来说太复杂,您可以简单地在电子表格中制作INSERT语句。 –
对不起,我是postgreSQL中的begginer,现在只能慢慢学习。我知道如何生成日期序列和整数。问题在于两者结合在一起。(交叉连接)。任何方式感谢链接 – RKR