sql insert into self(复制现有行)&增加外键

时间:2017-09-15 11:37:13

标签: mysql sql

我想复制表格中的所有现有行:

class CountableMeta(type):
    def __init__(cls, name, bases, attrs):
        cls.counter = 0  # each class gets its own counter

class Countable:
    __metaclass__ = CountableMeta

# in python 3 Countable would be defined like this:
#
# class Countable(metaclass=CountableMeta):
#    pass

class A(Countable):
    pass

print(Countable.counter) # 0
print(A.counter) # 0

Countable.counter += 1

print(Countable.counter) # 1
print(A.counter) # 0

但是我想为file_id添加一个值,因此插入的值有一个偏移量

0 个答案:

没有答案