simone/django-compositekey — Issue #1: ANSI SQL select IN and delete IN
Author: simone
Created: 2011-10-30 01:12:48+00:00
State: open

standard single primary key
SELECT * FROM AUTORI WHERE ID IN (1, 2, 3, 4, 5)

with a multiple field key (ID1 and ID2)

As has become the query with composite key?
SELECT * FROM AUTHORS WHERE ID_1 IN (1, 2, 3, 4, 5) AND IN ID_2 ("a", "b", "c", "d", "e")

:-(
This does not work, because it also select all the intersections

Obviously I need also the DELETE WHERE ***

We can also SELECT * WHERE (ID_1=1 AND ID_2="a") OR (..)
but is seem to be a bad smell