Gossamer Forum
Quote Reply
I did it! In reply to
Is there a way to do this in one query???


SELECT Access.ID, Access.Name,Access.AccessURL,Access.AccessText
FROM Access
WHERE Access.ID = ${$rec}{'AccessID'}


and

SELECT AccessAlternates.AccessID, Access.Name, Access.AccessURL, Access.AccessText
FROM AccessAlternates, Access
WHERE AccessAlternates.LinkID = $id AND AccessAlternates.AccessID = Access.ID


In Words: I need

1. From Table Access ONE

ID | Name | AccessURL | AccessText

Where ID = field-value.

and

2. From Table Access all

ID | Name | AccessURL | AccessText

Where in Table AccessAlternates LinkID = $id

AccessID | LinkID

2 | 1
3 | 1
4 | 1

AND

ID | Name | AccessURL | AccessText

2 | Area1 | http...1 | Desc1
3 | Area2 | http...2 | Desc2
4 | Area3 | http...3 | Desc3


Or the second in words:

Get all AccessID from AccessAlternates for the $ID
and then get all fields from Access where ID = all AccessID


Humpf - is this understandable?

Im happy it runs now, but maybe someone could make this to one query instead two :-)

Robert





Subject Author Views Date
Thread Pugdog - i really need help :-( Robert 4047 Jul 29, 2000, 9:36 PM
Thread Re: Pugdog - i really need help :-(
pugdog 3952 Jul 29, 2000, 9:45 PM
Thread I did it!
Robert 3960 Jul 30, 2000, 10:37 AM
Thread Re: I did it!
pugdog 3944 Jul 30, 2000, 8:46 PM
Thread Re: I did it!
Robert 3937 Jul 30, 2000, 11:40 PM
Post Re: I did it!
pugdog 3909 Jul 31, 2000, 8:33 AM