CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2000
    Posts
    129

    SQL SELECT Question

    I already have PHP do this but I am trying to trim the code down a bit. I am still pretty new to SQL.

    I have 2 tables one contains users ids and group ids, another contains group ids and group names. I want to run a querry that gets all the group ids for a specific user and then uses that result to get the group name from the other table.

    So something like:

    SELECT group_name FROM group_table WHERE group_id = (SELECT group_id WHERE user_id=3)

    Possible?

  2. #2
    Join Date
    Dec 2000
    Posts
    129

    Re: SQL SELECT Question

    Got it by using a join left

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

Featured