Re: [SQL] constraint with check

2010-12-13 Thread Jasen Betts
On 2010-12-13, Viktor Bojović wrote: > --0015175cd20209e2030497532e39 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: quoted-printable > > Hi > im trying to create foreign key constraint which checks not only the > existence of key in foreign table, but it has to check if no

[SQL] Aggregating by unique values

2010-12-13 Thread Lee Hachadoorian
Hello, I'm trying to count customers who have received services by ZIP code, but I want to count each customer only once even though customers may have received services on multiple dates, and therefore appear in the table multiple times. There *is* a separate customers table, but because of dirty

[SQL] constraint with check

2010-12-13 Thread Viktor Bojović
Hi im trying to create foreign key constraint which checks not only the existence of key in foreign table, but it has to check if node field has value=true but i don't know how to do that, so im asking for help. alter table wg.nc add CONSTRAINT "nc_fk" FOREIGN KEY ("Id1") REFERENCES "wg"."entiti

Re: [SQL] Regular Expression Match Operator escape character

2010-12-13 Thread Jasen Betts
On 2010-12-08, Gnanakumar wrote: > Hi, > > We're running PostgreSQL v8.2.3 on RHEL5. > > In some places in our application, we use Regular Expression Match Operator > (~* => Matches regular expression, case insensitive) inside WHERE criteria. > > Example: > SELECT ... > FROM ... > WHERE (SKILLS ~