Re: SQL Intersect like problem - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: SQL Intersect like problem
Date
Msg-id 20030205041947.GC11467@wolff.to
Whole thread Raw
In response to SQL Intersect like problem  ("Dinesh V" <dinesh@trailblazingsolutions.com>)
List pgsql-novice
On Tue, Feb 04, 2003 at 21:00:47 -0500,
  Dinesh V <dinesh@trailblazingsolutions.com> wrote:
> Hello Folks,
>
> I have 7.3.1 running, and have an interesting SQL problem, please help.
> Consider an Invoice Table with columns
>
> InvoiceId
> ProductId
> Quantity
>
> Given a set of ProductId and Quantity, I need to find the InvoiceId that
> correspond to it.  I can create a temp table with these 2 columns (ProductId
> and Quantity) if necessary.

Unless there is more to this problem, you can just do something like:
select InvoiceID from Invoice_table where
  ProductID = 'XXX' and Quantity = 'YYY';

pgsql-novice by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: locking granularity
Next
From: Tom Lane
Date:
Subject: Re: proc.h and lock.h