Results 1 to 3 of 3

Thread: What’s wrong in the following query?

  1. #1
    Registered
    Join Date
    Jun 2016
    Location
    india
    Posts
    1
    Rep Power
    0

    Question What’s wrong in the following query?

    pls tell me for this..
    SELECT subject_code, count(name)
    FROM students;

  2. #2
    target='_blank' snowmaker's Avatar
    Join Date
    Nov 2002
    Location
    West Virginia
    Posts
    3,458
    Rep Power
    22
    I know next to nothing MySQL related, but maybe the parentheses need to be escaped?
    -bruce /* somdcomputerguy */
    'If you change the way you look at things, the things you look at change.'

  3. #3

    Join Date
    Sep 2002
    Location
    Auckland
    Posts
    1,356
    Rep Power
    17
    Quote Originally Posted by malisha View Post
    pls tell me for this..
    SELECT subject_code, count(name)
    FROM students;
    Im not sure what its called - but I use special quotes


    SELECT `subject_code`, count(name) FROM students;


    When you use the column/field names - surround each name with the special quote (its to the left of "1" in the upper line of your keyboard - 1, 2,3, etc...

    hope that makes sense. Im not sure the rules re any quotes when using COUNT

Tags for this Thread

Posting Permissions

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