Subject | Re: Query plans and joins |
---|---|
Author | Svein Erling Tysvær |
Post date | 2006-01-10T14:04:53Z |
Well, you still have to find them all to get to the record you want.
I don't think this works, but it is worth giving a try:
SELECT
A.*,
B.DESCRIPTION
FROM
TEST_DETAIL A
LEFT JOIN
TEST B
ON
B.ID = A.FID
where not exists(Select * from test_detail A2
where a2.Code < a.Code or
(a2.Code = a.Code and a2.VNR < a.VNR))
Though - as I said - I doubt this will help you much speedwise. Sorry,
Set
I don't think this works, but it is worth giving a try:
SELECT
A.*,
B.DESCRIPTION
FROM
TEST_DETAIL A
LEFT JOIN
TEST B
ON
B.ID = A.FID
where not exists(Select * from test_detail A2
where a2.Code < a.Code or
(a2.Code = a.Code and a2.VNR < a.VNR))
Though - as I said - I doubt this will help you much speedwise. Sorry,
Set
--- In firebird-support@yahoogroups.com, Filip wrote:
> Hi Martijn,
>
> >Then don't ask for them "all at once" :-)
>
> >Seriously, you're asking the server for a complete resultset which
> >needs to be prepared.
>
> SELECT FIRST 1
> A.*,
> B.DESCRIPTION
> FROM
> TEST_DETAIL A
> /*
> LEFT JOIN
> */
> INNER JOIN
> TEST B
> ON
> B.ID = A.FID
> ORDER BY
> A.CODE,A.VNR
>
> I added FIRST 1 to both queries and got the same results. The left
> join is slow because it doesn't use UC_TEST_DETAIL_CODE_VNR and i
> would like to know why?
>
> >He sure does.
>
> U got his addy, mine seems offline a loooong time ago :)
>
> Greetings,
> Filip Moons