1 Replies - 777 Views - Last Post: 06 October 2009 - 05:53 AM Rate Topic: -----

#1 qaz1134  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 121
  • Joined: 21-May 08

SQL Inner Join Problem

Posted 06 October 2009 - 05:35 AM

hello everyone...
I have a problem regarding on sql about inner join.
i have this database 2 tables: table1 has 3 attributes and table2 has 4 attributes.
now i want to copy the exact data inputted from table1 to table2. I have used inner join but it only binds the 2 attributes and leaves the rest.

here's what I've done:
sql = "Select * From T1 Inner Join T2r On T1.At1=T2.At1"




is it possible to bind the other attributes using that code?
example: :unsure:
sql = "Select * From T1 Inner Join T2r On T1.At1=T2.At1 & T1.At2=T2.At2 & T1.At3=T3.At3" 



T1=Table1
T2=Table2
At1=attribute1
At2=attribute2
At3=attribute3

can you please help me with this? :cry2:
I would Really appreciate it to if you give me some link (tut) about it. :D

Is This A Good Question/Topic? 0
  • +

Replies To: SQL Inner Join Problem

#2 AdaHacker  Icon User is offline

  • Resident Curmudgeon

Reputation: 452
  • View blog
  • Posts: 811
  • Joined: 17-June 08

Re: SQL Inner Join Problem

Posted 06 October 2009 - 05:53 AM

Yes, it's possible you've got the right idea. Your only problem is that the logical AND in SQL is the "AND" keyword, not the ampersand. Plus you're calling the table T2r in the FROM, but I assume that's a typo.
Select * From T1 Inner Join T2 On T1.At1=T2.At1 AND T1.At2=T2.At2 AND T1.At3=T3.At3

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1