Re: [GENERAL] A better AND query?

2006-05-09 Thread Just Someone
The schema can change, but I rather not. The use case is a web app where you can tag items with tags (many-2-many). There are multiple items you can tag: contacts, schedules, lists, etc... And then you can search and categorize by tags. The standard for this if you look aroung the web is to retri

Re: [GENERAL] A better AND query?

2006-05-09 Thread Wayne Conrad
> tagged_type int -- points to the table this tag is tagging My head exploded right about here. Is the schema written in stone, or can it change? What is the use case for this schema? What's it for? What is a "tag" about? Best Regards, Wayne Conrad ---(end of

[GENERAL] A better AND query?

2006-05-09 Thread Just Someone
I'm trying to generate a query that will handle tags matching in a database. The simplified structure is create table contacts ( id serial primary key, name varchar ); create table books ( id serial primary key, name varchar ); create table tags ( id serial primary key, name varchar );