SQL-Question

Claudius Sailer Claudius at sailer-online.de
Sun Mar 6 21:56:14 CST 2005


Am 06. Mrz 2005 um 21:26 Uhr schrieb Ruslan Zasukhin:

> On 3/6/05 10:15 PM, "Claudius Sailer" <Claudius at sailer-online.de> 
> wrote:
>
>>
>> I would expect that following SQL should work, but I get
>> Error: line 3:1: unexpected token: null
>>
>> SELECT B.RecID, B.BDatum, KZ.Konto_Name, K.Kategorie_Name,
>> B.Betrag,
>> null,
>> B.Kommentar, B.Blocked
>> FROM Buchungen B, Kategorien K, Konten KZ
>> WHERE B.Kategorie_ID=K.RecID
>> AND (B.Ziel_Konto=KZ.RecID AND B.Herk_Konto='13')
>> AND B.Deleted='0'
>> UNION
>> SELECT B.RecID, B.BDatum, KZ.Konto_Name, K.Kategorie_Name,
>> null,
>> B.Betrag,
>> B.Kommentar, B.Blocked
>> FROM Buchungen B, Kategorien K, Konten KZ
>> WHERE B.Kategorie_ID=K.RecID
>> AND (B.Herk_Konto=KZ.RecID AND B.Ziel_Konto='13')
>> AND B.Deleted='0'
>> ORDER BY B.BDatum, KZ.Konto_Name, K.Kategorie_Name
>
> Actually SELECT NULL this is non-SQL92 standard.
>
> And I do not catch, why you want NULL in select?

When you see UNION-Statement you see first part

null, B.Betrag

and second part

B.Betrag, null

One part of UNION shows me all values comming to my account and second 
part of UNION shows me all values leaving my account.

This is the reason why I need there vice versa a value which is not a 
valid value. NULL is not a valid value in the sense of an integer or 
float at this point.

bye


Claudius



More information about the Valentina-beta mailing list