Re: SQL Intersect like problem

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Dinesh V <dinesh(at)trailblazingsolutions(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: SQL Intersect like problem
Date: 2003-02-05 04:19:47
Message-ID: 20030205041947.GC11467@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Feb 04, 2003 at 21:00:47 -0500,
Dinesh V <dinesh(at)trailblazingsolutions(dot)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';

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2003-02-05 06:27:33 Re: proc.h and lock.h
Previous Message Bruno Wolff III 2003-02-05 04:17:05 Re: locking granularity