MY CODE (Im using MS Access 2000 with JET Database engine)
SELECT fname, lname, em
FROM (SELECT f.firstname AS fname, f.lastname AS lname, f.email AS em
FROM ((Members p INNER JOIN
Friends i ON p.pk1 = i.p_pk1) INNER JOIN
Members f ON i.f_pk1 = f.p_pk1)
UNION ALL
SELECT p.firstname AS fname, p.lastname AS lname, p.email AS em
FROM ((Members p INNER JOIN
Friends i ON p.pk1 = i.f_pk1) INNER JOIN
Members f ON i.p_pk1 = f.p_pk1)) a
WHERE (em = '(e-mail address removed)')
My Tables
Members(all VARCHAR) SOME DATA
First_Name Alester Jude Carl Jones
Last_Name A B C J
FRIENDS(ALL VARCHAR)
My_E_Mail (e-mail address removed) (e-mail address removed) (e-mail address removed)
Friend_E_Mail (e-mail address removed) (e-mail address removed) (e-mail address removed)
***NOTE Friends Table ALLOWS duplicates so jude can be on my_E_Mail but CAN NOT add alester because they are already friends.
Desired Output if ("?" in above query is: (e-mail address removed))
+--------------+-----------+------------+
|Member |E_Mail | Name |
+---------------------------------------+
Alester A (e-mail address removed) Alester
Desired Output if("?" in above query is: (e-mail address removed))
+--------------+-----------+------------+
|Member |E_Mail | Name |
+---------------------------------------+
Jude B (e-mail address removed) Jude
carl C (e-mail address removed) Carl
Jones J (e-mail address removed) Jones
PS the "?" are query string parameters that im passing in the "?" i know that works fine.
MY QUESTION IS : i keep getting this error "QUERY TOO COMPLEX ERROR"
is their a work around query i can use without using a stored procedure/trigger/seperate queries since this needs to be ONE SINGLE QUERY!?
Thanks.
SELECT fname, lname, em
FROM (SELECT f.firstname AS fname, f.lastname AS lname, f.email AS em
FROM ((Members p INNER JOIN
Friends i ON p.pk1 = i.p_pk1) INNER JOIN
Members f ON i.f_pk1 = f.p_pk1)
UNION ALL
SELECT p.firstname AS fname, p.lastname AS lname, p.email AS em
FROM ((Members p INNER JOIN
Friends i ON p.pk1 = i.f_pk1) INNER JOIN
Members f ON i.p_pk1 = f.p_pk1)) a
WHERE (em = '(e-mail address removed)')
My Tables
Members(all VARCHAR) SOME DATA
First_Name Alester Jude Carl Jones
Last_Name A B C J
FRIENDS(ALL VARCHAR)
My_E_Mail (e-mail address removed) (e-mail address removed) (e-mail address removed)
Friend_E_Mail (e-mail address removed) (e-mail address removed) (e-mail address removed)
***NOTE Friends Table ALLOWS duplicates so jude can be on my_E_Mail but CAN NOT add alester because they are already friends.
Desired Output if ("?" in above query is: (e-mail address removed))
+--------------+-----------+------------+
|Member |E_Mail | Name |
+---------------------------------------+
Alester A (e-mail address removed) Alester
Desired Output if("?" in above query is: (e-mail address removed))
+--------------+-----------+------------+
|Member |E_Mail | Name |
+---------------------------------------+
Jude B (e-mail address removed) Jude
carl C (e-mail address removed) Carl
Jones J (e-mail address removed) Jones
PS the "?" are query string parameters that im passing in the "?" i know that works fine.
MY QUESTION IS : i keep getting this error "QUERY TOO COMPLEX ERROR"
is their a work around query i can use without using a stored procedure/trigger/seperate queries since this needs to be ONE SINGLE QUERY!?
Thanks.