Re: [sqlite] Re: How do I do this

2008-01-13 Thread miguel manese
On Jan 14, 2008 9:09 AM, Vishal Mailinglist <[EMAIL PROTECTED]> wrote: > > sno | id | amount > > > 1| 1 | 200 > > > 2| 1 | 300 > > > 3 | 2 | 100 > > > 4 | 2 | 100 > > > 5 | 1 | 500 > What if I do not have control over sno i.e it is random or unpredictable , > I want to subtract it in

Re: [sqlite] Re: How do I do this

2008-01-13 Thread Vishal Mailinglist
Hi , I knew I was not explaining better. > sno | id | amount > > 1| 1 | 200 > > 2| 1 | 300 > > 3 | 2 | 100 > > 4 | 2 | 100 > > 5 | 1 | 500 > > > > how could I subtract the sno 1 id 1 and sno 2 id 1 amount . > > select > (select amount from tableName where sno=1 and id=1) - >

[sqlite] Re: How do I do this

2008-01-11 Thread Igor Tandetnik
Vishal Mailinglist wrote: Did not know how to do this on a database that I have in sqlite sno | id | amount 1| 1 | 200 2| 1 | 300 3 | 2 | 100 4 | 2 | 100 5 | 1 | 500 how could I subtract the sno 1 id 1 and sno 2 id 1 amount . select (select amount from tableName where sno=1