Re: SQL Query
| От | Tariq Muhammad |
|---|---|
| Тема | Re: SQL Query |
| Дата | |
| Msg-id | Pine.LNX.4.21.0211291426340.21306-100000@genesis.int.libertyrms.com обсуждение исходный текст |
| Ответ на | SQL Query (Scott Taylor <scott.taylor@4i-dotcom.com>) |
| Список | 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 по дате отправления: