Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Question Unanswered: Substitute value of one field with value from another one ?

    Hi, everyone.

    If I have a Table 1 with these fields:

    Name | Surname | Function

    record sample:

    Joe | Blow | 430

    ...and Table 2 with two fields, first one having IDs of Table 1's "Function" field and second one with their description:

    ID | Description

    record sample:

    430 | IT manager

    How would I do queries on Table 1 to pull out description from Table 2 instead of ID value of "Function" field in Table 1 ? In other words, I need to substitute ID codes from Table 1 with Descriptions from Table 2, making a kind of relational queries.

    I know there's a way of using query inside another query, but have no idea how to get current record's field and pull other table's substitution instead of it, all in one query.

    Thank you for all suggestions !

  2. #2
    Join Date
    Feb 2003
    Denver, CO
    I didn't test this, but it's something like this example using a simple join:

    SELECT table1.Name, table1.Surname, table2.Description FROM table1, table2 WHERE table1.Function = table2.ID

Posting Permissions

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