Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2014

    Hello, rank beginner here. Extremely basic question....

    I've started teaching myself SQL for fun. I read "The Manga Guide to Databases" to get an overview then discovered this site. At any rate, I just started and am curious about the very first set of exercises. When I write:

    select *
    from empinfo
    where age > 40;
    I get an error. The correct answer is

    select * from empinfo
    where age > 40;
    Is there a special property of "*" such that it needs to be on the same line as the FROM statement? Because the following two are equivalent and return the same thing, and neither give me an error message:

    select age
    from empinfo
    select age from empinfo
    I realise this is probably a silly question, but there you have it.

  2. #2
    Join Date
    Feb 2014
    Riviera Beach, Maryland, USA
    According to w3schools.com, it looks like the correct SQL SELECT Syntax is:

    SELECT column_name,column_name
    FROM table_name;


    SELECT * FROM table_name;

    It doesn't explain why, just that's the way it is. <shrug>

Posting Permissions

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.