Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: exclude par...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3551 of 3717
Post > Topic >>

Re: exclude part of result

by postgresql@[EMAIL PROTECTED] (Tarlika Elisabeth Schmitz) Jun 27, 2008 at 07:51 AM

On Thu, 26 Jun 2008 19:49:01 -0400 (EDT)
"Patricia Mitchell"<patricia-mitche@[EMAIL PROTECTED]
> wrote:

> The columns (a,b,c) of the navigation table should not appear in the
> result because you are only pulling records from the product and item
> table.  You are pulling the records out of the product and item table
> with this statement:  'select a,b,c, count()....from product LEFT
> JOIN item on....'
> 
> 
> 
> P.M.
> 
>  --- On Thu 06/26, Tarlika Elisabeth Schmitz <
> postgresql@[EMAIL PROTECTED]
 > wrote:
> 
> From: Tarlika Elisabeth Schmitz [mailto:
> postgresql@[EMAIL PROTECTED]
> 
> To: pgsql-sql@[EMAIL PROTECTED]
> 
> Date: Fri, 27 Jun 2008 00:35:38 +0100
> 
> Subject: [SQL] exclude part of result
> 

> 
> SELECT DISTINCT a, b, c, now(), count(item_pk) 
> FROM product
> LEFT JOIN item ON item.product_fk = product_pk
> WHERE ...
> GROUP BY a, b, c
> 
> 
> I have another table 'navigation' which also has the columns a,b,c
> 
> If the combination of (a,b,c) exists in 'navigation', then exclude it
> from above result. How can I achieve this?

Thank you for your response, Patricia.

Maybe I did not express myself clearly enough:
Example:

PRODUCT table :

A B C
100 200 300
100 200 301
100 205 300
100 205 301

NAVIGATION table
A B C #ITEMS
100 200 300 5
100 200 301 6



My query needs to return 
100 205 300 #items
100 205 301 #items
so I can insert them in NAVIGATION. NAVIGATION must not contain any
duplicate combinations of [a,b,c].




--


Best Regards,

Tarlika Elisabeth Schmitz


A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad? 

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 3 Posts in Topic:
Re: exclude part of result
postgresql@[EMAIL PROTECT  2008-06-27 07:51:36 
Re: exclude part of result
hari.fuchs@[EMAIL PROTECT  2008-06-27 11:33:07 
Re: exclude part of result
M.Mamin@[EMAIL PROTECTED]  2008-06-27 12:50:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 21:00:51 CDT 2008.