[V4RB 0000496]: SQL-Problem

Claudius Sailer Claudius at sailer-online.de
Mon Feb 28 16:31:30 CST 2005


Hi Ruslan,

Am 27. Feb 2005 um 11:58 Uhr schrieb Ruslan Zasukhin:

> On 2/27/05 12:39 PM, "vbt at paradigma.ukrcom.kherson.ua"
> <vbt at paradigma.ukrcom.kherson.ua> wrote:
>
>> Summary:                    SQL-Problem
>> Description:
>> Following Code has result 0 records
>>
>> SELECT KO.Konto_Typ, KZ.Konto_Typ, B.Kategorie_ID, B.Betrag FROM 
>> Buchungen
>> B, Konten KO, Konten KZ
>> WHERE B.Herk_Konto=KO.RecID
>> AND B.Ziel_Konto=KZ.RecID
>> AND B.Deleted='0'
>> AND B.BDatum<='27.02.2005'
>>
>> but it should have a lot
>
> Hi Claudius,
>
> I will recommend redo query using new SQL92 syntax of joins.
> This make query more clean.
>
>
> SELECT
>     KO.Konto_Typ, KZ.Konto_Typ, B.Kategorie_ID, B.Betrag
> FROM
>     Buchungen B join Konten KO ON B.Herk_Konto=KO.RecID
>                 join Konten KZ ON B.Ziel_Konto=KZ.RecID
> WHERE
>     B.Deleted='0' AND B.BDatum<='27.02.2005'

faster too?
I don't know SQL92 syntax. I am a sybase hacker with learning by seeing 
and rebuilding ;-))
The syntax you show me is a little bit confusing me.

How is it realized when I want to do following?

SELECT KO.Konto_Typ, KZ.Konto_Typ, B.Kategorie_ID, B.Betrag
FROM Buchungen B, Konten KO, Konten KZ
WHERE B.Herk_Konto=KO.RecID
AND B.Ziel_Konto=KZ.RecID
AND KO.Konto_Type = 1
AND B.Deleted='0'
AND B.BDatum<='27.02.2005'

is it then

SELECT
     KO.Konto_Typ, KZ.Konto_Typ, B.Kategorie_ID, B.Betrag
FROM
     Buchungen B join Konten KO ON B.Herk_Konto=KO.RecID
                 join Konten KZ ON B.Ziel_Konto=KZ.RecID
WHERE KO.Konto_Type=1
AND B.Deleted='0' AND B.BDatum<='27.02.2005'

in other words, when I have in restrictions something from joined 
tables? where is this written?

bye


Claudius

-- 
G4/733 QS / MacOS X 10.3.7de / RB 5.5.3de/ Valentina 1.10.0 & 2.0bX
Homepage	http://www.ClaSai.de
iChat		ryhoruk
RealBasic ListBoxes: [ I feel the need...the need for speed!!! ]



More information about the Valentina-beta mailing list