Re: Basic Query Question

Поиск
Список
Период
Сортировка
От Ramy Abdel-Azim
Тема Re: Basic Query Question
Дата
Msg-id 4EDFD467.9010903@startdatelabs.com
обсуждение исходный текст
Ответ на Basic Query Question  (Jude Lucien <jlucien@gmail.com>)
Ответы Re: Basic Query Question  (Jude Lucien <jlucien@gmail.com>)
Список pgsql-novice
i'm not sure but i think not being explicit about the join causes psql
to try to join on ID.

What are you getting? an error or an empty result set?

I would think you should do the join explicitly like this:

select bike.bike_id from bike  join booking on bike.bike_id =
booking.bike_id where booking.date != '2011-11-20'

On 12/7/11 3:55 PM, Jude Lucien wrote:
> Sorry for the basic question, I can't seem to figure it out.
>
> I have two tables, booking and bike.  Both have bike_id as primary key.
>
> I am trying to return all bike_id's where bike.model='Kona' AND
> booking.booking_date DOES NOT EQUAL 'date';
>
> My query is as follows:
>
> SELECT bike.bike_id FROM bike,booking WHERE bike.model='model' AND
> booking.booking_date!='2011-11-20' AND bike.bike_id=booking.bike_id;
>
> Any help appreciated!
>
> Jude
>
>
>


В списке pgsql-novice по дате отправления:

Предыдущее
От: Jude Lucien
Дата:
Сообщение: Basic Query Question
Следующее
От: Jude Lucien
Дата:
Сообщение: Re: Basic Query Question