Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: INNER JOIN problem

    Hello,

    Im using INNER JOIN to join 2 tables that have a column named "id". After I get the recordset I need to use both ids, so I thought I could write:

    RS.fields.item("table1.id").value and
    RS.fields.item("table2.id").value

    but i get an error saying the column doesnt exist in the recordset.

    if I write
    RS.fields.item("id").value
    I get the wrong one in some cases.

    What can I do?

    Im using ASP with MySQL by the way.

    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    You probably want to post this in te MySQL section instead of the ASP section. However, you should able to rename your fields in your select query.

    I don't know how MySQL does it but in MS SQL it would be something like...

    Select table1.id as 'ID1', table2.id as 'ID2' etc.....

    Then you can use myRecordset("ID1") or myRecordset("ID2")

    Having said that, if you are joining on this field then they will always be the same.... won't they?????

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •