Re: Selecting rows from 4 in one to many relationship, please help

2010-03-07 Thread Dennis Kaarsemaker
On zo, 2010-03-07 at 01:53 -0800, Alexis Selves wrote: > InternalError: current transaction is aborted, commands ignored until > end of transaction block http://docs.djangoproject.com/en/dev/topics/db/transactions/#handling-exceptions-within-postgresql-transactions -- Dennis K. The universe ten

Re: Selecting rows from 4 in one to many relationship, please help

2010-03-07 Thread Alexis Selves
Yes, sure, raw sql is not problem for me. But if I want to perform simple query like SELECT * FROM cars; It give this: InternalError: current transaction is aborted, commands ignored until end of transaction block I am using postgres and karmic coala.. On 6 bře, 19:44, Matthew Warren wrote: > Fr

Re: Selecting rows from 4 in one to many relationship, please help

2010-03-06 Thread Matthew Warren
>From what you've written, my best guess would be something like, select car.id where car.id in (Select CarOperation.id_car where CarOperation.status='exact') and car.id not in (select CarReservation.id_car where GIVEN_DATE > CarReservation.ariv_date and GIVEN_DATE < CarReservation.dep_date) That

Selecting rows from 4 in one to many relationship, please help

2010-03-06 Thread Alexis Selves
Hello! I have four tables: Car(id, manufacturer, kind) CarReservation(id, id_car, dep_date,ariv_date) CarOperation(id, id_car, id_parking, status...) Parking(id, street, gps) Now I need to select cars, which are on exact parking and are not reserved for given date.. I am totally hopelles..