left join help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rick Pasotto

    #1

    left join help

    One of these days I will maybe understand...

    Using MYSQL 4.0.13, debian linux

    create table members (
    id unsigned int autoincrement,
    name
    )

    create table activity (
    id unsigned int autoincrement,
    description
    )

    create table history (
    id unsigned in autoincrement,
    date date,
    member_id unsigned int,
    activity unsigned int
    )

    What I need:
    1) only records for a particular date
    2) there should be at least one record for each activity
    3) there may be multiples of the same activity on a given date
    4) there may be multiples of the same member on a given date
    5) not all members will be listed
    6) the members.name result field may be NULL

    SELECT history.date, activity.descri ption, members.name
    ???
    WHERE history.date = 'YYYY-MM-DD'

    --
    "A little inaccuracy sometimes saves tons of explanation."
    -- H. H. Munro (Saki)
    Rick Pasotto rick@niof.net http://www.niof.net

    --
    MySQL General Mailing List
    For list archives: http://lists.mysql.com/mysql
    To unsubscribe: http://lists.mysql.com/mysql?unsub=m...ie.nctu.edu.tw

Working...