Re: join and sort on 'best match' - Mailing list pgsql-sql

From Ragnar
Subject Re: join and sort on 'best match'
Date
Msg-id 1166212007.6369.194.camel@localhost.localdomain
Whole thread Raw
In response to Re: join and sort on 'best match'  ("Ashish Ahlawat" <ahlawat.ashish@gmail.com>)
List pgsql-sql
On fös, 2006-12-15 at 22:10 +0530, Ashish Ahlawat wrote:
>  
>  
> Hi team
>  
> I was just asking that If table ITEM3 has all the columns then why we
> need to have a join ?? even we put a sorting very easily.

> On 12/14/06, Markus Schaber <schabi@logix-tt.com> wrote: 
>         Hi, Ashish,
>         
>         "Ashish Ahlawat" <ahlawat.ashish@gmail.com> wrote:
>         
>         > if table *Item 3 : news, nature, greenpeace, whale has all
>         clmn y v need
>         > join ??*

it seems these where not columns of a table.

the organisation was like this:

table items:

id   name
-----------
1    foo
2    bar
3    item3


table tags:

tag_id   text
---------------------
1        news
2        nature
3        tennisballs
4        greenpeace
5        cannibals
6        whale

and table items_tags:

item_id  tag_id
----------------
3        1
3        2
3        4
3        6
...


so table items needs to be joined to table tags via 
table items_tags to retrieve the connections from item3
to news, nature, greepeace and whales.

gnari




pgsql-sql by date:

Previous
From: "Ashish Ahlawat"
Date:
Subject: Re: join and sort on 'best match'
Next
From: "Aaron Bono"
Date:
Subject: Unions and Grouping