Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    14

    Unanswered: SQL problem in mysql

    INSERT INTO task (user_id, poster_id, project_id, mount_id, subject, time, finish, priority_id, type_id, status_id) VALUES (999, 999, 111, (select MAX(ID) from task where subject = 'Software', 'training', -1, -1, 2, 2, 1);

    and

    UPDATE task SET mount_id = 2
    Where Id = select Max(ID) from task where subject ='Consulting';

    they both gave me this error :

    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 'select Max(ID) from task where subject ='Consulting'' at line 1

    Please and Thank You

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: SQL problem in mysql

    Originally posted by Paingiver
    INSERT INTO task (user_id, poster_id, project_id, mount_id, subject, time, finish, priority_id, type_id, status_id) VALUES (999, 999, 111, (select MAX(ID) from task where subject = 'Software', 'training', -1, -1, 2, 2, 1);

    and

    UPDATE task SET mount_id = 2
    Where Id = select Max(ID) from task where subject ='Consulting';

    they both gave me this error :

    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 'select Max(ID) from task where subject ='Consulting'' at line 1

    Please and Thank You
    What version of MySQL you are using?

Posting Permissions

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