I have been trying to learn sql but am struggling. I have a lot of respect for u guys that are good at handling data. I've been trying to use one record for more than one row. Hard to explain, hopefully this will make sense: table 1 A B 1 1 ------- table 2 id name 1 test ----------- SELECT table2.C AS A, table2.C AS B FROM table1, table2 WHERE (table2.id=table1.A) AND (table2.id=table1.B) I am struggling so much with this. Please help.
First of, I would explicitly state your JOIN instead of putting it in the where clause. I think you're confused about the table2.C AS A and table2.C AS B. Are you trying to select the name from table 2, or something else? These don't make sense as written. SELECT table2.name FROM table1 INNER JOIN table2 ON (table1.A = table2.id AND table1.B = table2.id)
thank u for taking the time to help me out. I learned a lot from ur post . Much love. Yeh sorry i made a mistake but u still figured it out nice one.