SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with Mysql Query

    Hi Guys,

    I am struck with a mysql query..please help me out

    I have two tables....1st table for clicks and 2nd table for sales

    clicks
    -------
    Date
    UserID
    BookID

    Sales
    -----
    Date
    UserID
    BookID

    I want to get an output like the following

    --------------------------------------------------------
    Date | clicks | Sales |
    --------------------------------------------------------
    2010-02-01 | 20 | 2 |
    --------------------------------------------------------
    2010-02-02 | 12 | 0 |
    ---------------------------------------------------------
    2010-02-01 | 14 | 1 |
    ---------------------------------------------------------

    I am trying the query with group by and left join..but not working

    Please help me out

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,262
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by heretic123 View Post
    I am trying the query with group by and left join..but not working
    please show your query
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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