1
私のSQLクエリは次のようになります。DjangoでMySQLのjoinクエリを実行するには?端末内に完全に実行さ
select t.txid, t.from_address, t.to_address, t.value, t.timestamp,
t.conformations, t.spent_flag,t.spent_txid from transaction_details t
where t.to_address =(select distinct a.address from address_master a
inner join panel_user p on a.user = p.user and a.user= "auxesis");
今、私はこのようにジャンゴにそれを使用してみました:
sql = """ select t.txid, t.from_address, t.to_address,t.value, t.timestamp, t.conformations, t.spent_flag,t.spent_txid from
transaction_details t where t.to_address =(select distinct a.address from
address_master a inner join panel_user p on a.user = p.user and a.user= "%s" """),%(user)
cursor.execute(sql)
res = cursor.fetchall()
しかしyaはその作業はありません。だから誰もそれで私を助けてください?
組み込みのORMを使用しないのはなぜですか? –
さらに、SQLコマンドを作成するために文字列補間は絶対に使用しないでください。 –