Hello, rank beginner here. Extremely basic question....
Results 1 to 2 of 2

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

  1. #1
    Join Date
    Aug 2014
    Posts
    1

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

    Hi,
    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
    Location
    South Florida, U.S.A.
    Posts
    34
    According to w3schools.com, it looks like the correct SQL SELECT Syntax is:

    SELECT column_name,column_name
    FROM table_name;

    and

    SELECT * FROM table_name;

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

Posting Permissions

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