Need Help write MySQL query

Discussion in 'MySQL' started by eddiemoth, Feb 27, 2012.

  1. #1
    I am having problem to write MySQL query to get data from 2 tables in the same database - one of them is Jomsocial table and the other is Joomla table) and hope to get some help from our friends here.

    First table

    jml_community_users

    userid
    points

    Second table

    jml_users

    userid
    name


    I like to get the name and points of each member since 01/01/2012. I was trying to use Straight Join but having problems and also have problem with the date as well. I appreciate for any help you can spare. Thanks a lot.
     
    eddiemoth, Feb 27, 2012 IP
  2. trendint

    trendint Peon

    Messages:
    52
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    SELECT
        u.userid,
        cu.points
    FROM
        jml_users AS u LEFT JOIN jml_community_users AS cu ON u.userid = cu.userid
    WHERE
        DATE(u.registerDate) >= DATE('2012-01-01')
    
    Code (markup):
     
    trendint, Feb 28, 2012 IP
  3. eddiemoth

    eddiemoth Peon

    Messages:
    75
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you!
     
    eddiemoth, Mar 5, 2012 IP