Re: enforcing with unique indexes..

Поиск
Список
Период
Сортировка
От Rajesh Kumar Mallah.
Тема Re: enforcing with unique indexes..
Дата
Msg-id 200210051248.10550.mallah@trade-india.com
обсуждение исходный текст
Ответ на enforcing with unique indexes..  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
Список pgsql-sql

Sorry Bhuvan it wont work,

COMPOSITE UNIQUE INDEX will prevent entry of rows like (group_id,user_id)

1 1
1 1

what i want to prevent is this:

1 1
1 2

did you notice the distinct inside the count?
regds
mallah.





On Saturday 05 October 2002 12:36, Bhuvan A wrote:
> > SELECT  group_id  from eyp_listing group by group_id  having
> > count(distinct userid) > 1  ;
> >
> > always returns empty.
> >
> > can it be done with some sort of UNIQUE INDEX?
>
> Yes it can be done using UNIQUE INDEX. Create a composite unique index on
> these 2 fields and it will do the rest. For more details, try
>
> $ \h CREATE INDEX
>
> regards,
> bhuvaneswaran

--
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.




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

Предыдущее
От: "Rajesh Kumar Mallah."
Дата:
Сообщение: enforcing with unique indexes..
Следующее
От:
Дата:
Сообщение: Re: enforcing with unique indexes..