Re: SQL Query - Mailing list pgsql-general

From Tariq Muhammad
Subject Re: SQL Query
Date
Msg-id Pine.LNX.4.21.0211291426340.21306-100000@genesis.int.libertyrms.com
Whole thread Raw
In response to SQL Query  (Scott Taylor <scott.taylor@4i-dotcom.com>)
List 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@libertyrms.info
v:416-646-3304 x 111
c:416-993-1859
p:416-381-1457


pgsql-general by date:

Previous
From: Scott Taylor
Date:
Subject: SQL Query
Next
From: Scott Lamb
Date:
Subject: Re: SQL Query