Re: SQL Query

From: Tariq Muhammad <tmuhamma(at)libertyrms(dot)com>
To: Scott Taylor <scott(dot)taylor(at)4i-dotcom(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL Query
Date: 2002-11-29 19:32:27
Message-ID: Pine.LNX.4.21.0211291426340.21306-100000@genesis.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 29 Nov 2002, Scott Taylor wrote:

> I have submitted this query to the list before, but have since upgraded
> to a later version so I lost the command history.
>
> >From the below output, could someone tell me how to return rows only
> where:
>
> 1. If chart_id=10074, return all rows with same trans_id (i.e. trans_id
> 10088 and 10101)
> 2. Where amount >=0
> 3. With transdate between 2002-07-01 and 2002-09-30

SELECT trans_id, chart_id, amount, transdate
FROM acc_trans
WHERE chart_id = 10074 AND
trans_id in (10088,10101) AND
amount >=0 AND
transdate BETWEEN '2002-07-01' AND '2002-09-30';

Tariq Muhammad
Liberty RMS
tariq(at)libertyrms(dot)info
v:416-646-3304 x 111
c:416-993-1859
p:416-381-1457

In response to

  • SQL Query at 2002-11-29 19:23:56 from Scott Taylor

Browse pgsql-general by date

  From Date Subject
Next Message Scott Lamb 2002-11-29 20:07:50 Re: SQL Query
Previous Message Scott Taylor 2002-11-29 19:23:56 SQL Query