select fieldname based on query result
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: select fieldname based on query result

  1. #1
    Join Date
    Jul 2009
    Posts
    1

    select fieldname based on query result

    Hi,

    i have three table
    1)lgn_grpmgt
    2)grpmgt_sub (this is subtable of lgn_grpmgt)
    3)lgn_menumgt

    "lgn_grpmgt" having the field like 'grpid','grpname'
    "grpmgt_sub" having the field like 'grpid','menuid'
    "lgn_menumgt' having the field like 'menuid','menuname'

    i want to get the column 'menuid' from "grpmgt_sub" and 'menuname' for the corresponding 'menuid' from "lgn_menumgt" where grpid='grp id i pass'

    pls send me the query for this, it ll be very helpful for me

    thanks

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    3,997
    Take a look at the case command. You can use to to choose which column to output.
    this space intentionally left blank

Posting Permissions

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



Click Here to Expand Forum to Full Width