Help with SQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pjhyett@gmail.com

    Help with SQL

    What I'd like is given a map id, grab all of the users that point to
    that map id. Can anybody point me in the right direction?

    Map
    -----
    id
    .....

    User
    -------
    id
    .....

    mbookmark
    ----------------
    map_id
    user_id

    Thanks,
    PJ

  • Aggro

    #2
    Re: Help with SQL

    pjhyett@gmail.c om wrote:[color=blue]
    > What I'd like is given a map id, grab all of the users that point to
    > that map id. Can anybody point me in the right direction?[/color]

    select User.* from User,mbookmark
    where mbookmark.map_i d = X AND User.id=mbookma rk.user_id;

    Replace X with the map id you have. You should have indexes in User.id
    and in mbookmark.map_i d.

    Comment

    Working...