Click to See Complete Forum and Search --> : [RESOLVED] Finding field, with reference from reference


alt
10-10-2007, 02:12 PM
Okay. I have 3 tables.

table1
-------
ohlink | ptlink


table2
-------
ptlink | colink


table3
-------
colink | name



=======================

I want to be able to find table3.name from matching the "colink" in table2, which has to look at the ptlink from table1 based on the ohlink field.

Does that make sense?

alt
10-10-2007, 02:30 PM
Okay, here is what I would think would work to give you a better idea of what im trying to do..I know im leaving something stupid out. My brain is fried right now!

SELECT T3.NAME FROM TABLE1 T1, TABLE2 T2, TABLE3 T3 WHERE T1.OHLINK=800877 AND T2.PTLINK=T1.PTLINK AND T3.COLINK=T2.COLINK

alt
10-12-2007, 09:55 AM
Okay so...I had this working from the beginning (I thought I was just stupid). Turns out there was no value in "table2" that matched the one in "table1".


PEBKAC :eek: