Код: Выделить всё
my_dictionary = {
"sec_identifier": ["ukey", "date", "id_1"],
"sec_profile": ["ukey", "date", "amount", "name"],
"sec_sch": ["ukey", "date", "interest","price"]
}
Код: Выделить всё
ukeyКод: Выделить всё
SELECT si.id_1, sp.amount, sp.name, sc.interest, sc.price FROM sec_profile sp
INNER JOIN sec_identifier si ON (sp.ukey, sp.date) = (si.ukey, si.date)
INNER JOIN sec_sch sc ON (sp.ukey, sp.date) = (sc.ukey, sc.date)
Код: Выделить всё
INNER JOINЯ пытался сохранить операторы INNER JOIN такими же и просто динамически заменять si.id_1, sp. сумма, sp.name, sc.interest, sc.price на основе моего словаря. Однако мне не удалось динамически сгенерировать весь INNER JOIN.
Подробнее здесь: https://stackoverflow.com/questions/790 ... dictionary