Thnaks, Mohd and Dan,
Dan, Your suggestion worked OK! Both on sqlite and MS SQL SERVER 2005.
The whole select statement as an argument to coalesce function.
Thanks
Aivars
2008/12/1 Dan <[EMAIL PROTECTED]>:
> If you are sure there is at most one entry in bilance1 where the account
> and year
If you are sure there is at most one entry in bilance1 where the account
and year match then you could do this:
SELECT coalesce(
(SELECT dbs from bilance1 where account='13100' and pYear=?),
0
) AS summadeb;
On Dec 1, 2008, at 3:26 PM, aivars wrote:
> Hello,
>
> The simple
rs@sqlite.org>
Sent: Monday, December 01, 2008 4:26 PM
Subject: [sqlite] please help with NULL and NOTHING?
> Hello,
>
> The simple query is like this:
> SELECT dbs as summadeb from bilance1 where account='13100' and pYear=?;
>
> Account number 13100 is not present
Hello,
The simple query is like this:
SELECT dbs as summadeb from bilance1 where account='13100' and pYear=?;
Account number 13100 is not present in the table bilance1 when
pYear=2005 and it should be like this and therefore dbs is also not
present. Other years account number 13100 is present
4 matches
Mail list logo