MySQL syntax

Posted on 2012-09-19
Last Modified: 2012-09-19
This SQL fails:

SELECT * from schedule where date = '2012-09-20', * from cancellation_list where sc = 'Y' and sc_date = '2012-09-20'

The table schedule has a column date and the table cancellation_list has columns sc and sc_date.

The error is:

#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near ' * from cancellation_list where sc = 'Y' and sc_date = '2012-09 .

What is the correct syntax?
Question by:Richard Korts
    1 Comment
    LVL 12

    Accepted Solution

    Try this.

    select * from schedule s inner join cancellation_list c
    on = c.sc_date
    where = 'Y' and c.sc_Date = '2012-09-20'

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi ( had suggested a “sed” way, I actually shell …
    More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now