Results 1 to 2 of 2

Thread: Query question

  1. #1
    Join Date
    Jul 2004
    Posts
    268

    Unanswered: Query question

    Hi All,

    I have a query that looks like this:

    select table3.lastname, table1.stationid, table2.entryuserid, table2.updateuserid
    from table1 vp, table2 tr, table3 emp
    where table3.empid = table2.empid and
    table3.positionid = table1.positionid


    Table 1 stores stationids
    Table 2 stores entryuserids, updateuserids
    Table 3 stores lastnames

    I need to translate table2.entryuserid and table2.updateuserid to their lastnames from table3. Please help. Thanks.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    First, rewrite your query using JOINs:

    Code:
    select	table3.lastname,
    	table1.stationid,
    	table2.entryuserid,
    	table2.updateuserid
    from	table3
    	inner join table2 on table3.empid = table2.empid
    	inner join table1 on table3.positionid = table1.positionid
    ...then, tell us what you mean by "translate". You mean update the data?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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