3 ms·
That, and typing "select x from table A, table B where tableA.foreign_key = tableB.index and tableA.index=5" is a little long-winded and more prone to error, wh
by manicdee 12y ago
That, and typing "select x from table A, table B where tableA.foreign_key = tableB.index and tableA.index=5" is a little long-winded and more prone to error, when you can just do x = ModelA.objects.get(pk=5).ModelB
- chris_mahan 12y agoSELECT B.x FROM tableA A JOIN tableB B on A.foreign_key = B.index WHERE A.index = 5 That's very simple, if you know SQL. I think