markhan
Programmer
- Mar 9, 2011
- 11
Hi all!
I was wondering if someone could help me a little with this query.
My intention is to use a Self join but i'm not transforming the query properly.
Database: Access 2000
My actual query is like this:
SELECT l.SN, l.VN, l.GN, l.LD
FROM l
WHERE (((l.SN)='X') AND ((l.VN)='Y') AND ((l.GN)='Z') AND ((l.LD)<=(Select MIN(l2.LD) from l l2 where ((l2.SN)='X') AND ((l2.VN)='Y') AND ((l2.GN)='Z') )));
This works fine but I would like to transform it to a self join.
In case it helps what i would like to do in the query is Obtaining the minimun value from LD and show SN, VN, GN, LD for that value
This last query is what i would like to do but is a wrong query as Access shows error while trying to use it.
SELECT l.SN, l.VN, l.GN, MIN(l.LD)
FROM l
WHERE l.SN = 'X' AND l.VN = 'Y' AND l.GN = 'Z'.
Thanks in advance for the help and sorry if i didnt explain it correctly.
regards
I was wondering if someone could help me a little with this query.
My intention is to use a Self join but i'm not transforming the query properly.
Database: Access 2000
My actual query is like this:
SELECT l.SN, l.VN, l.GN, l.LD
FROM l
WHERE (((l.SN)='X') AND ((l.VN)='Y') AND ((l.GN)='Z') AND ((l.LD)<=(Select MIN(l2.LD) from l l2 where ((l2.SN)='X') AND ((l2.VN)='Y') AND ((l2.GN)='Z') )));
This works fine but I would like to transform it to a self join.
In case it helps what i would like to do in the query is Obtaining the minimun value from LD and show SN, VN, GN, LD for that value
This last query is what i would like to do but is a wrong query as Access shows error while trying to use it.
SELECT l.SN, l.VN, l.GN, MIN(l.LD)
FROM l
WHERE l.SN = 'X' AND l.VN = 'Y' AND l.GN = 'Z'.
Thanks in advance for the help and sorry if i didnt explain it correctly.
regards