Results 1 to 4 of 4

Thread: what's wrong with my SQL Statement(MySQL)????

  1. #1
    Join Date
    Feb 2003
    Posts
    4

    what's wrong with my SQL Statement(MySQL)????

    select * from StaffDetail, Division, Dept where StaffID in ('1','2'), StaffDetail.DivID = Division.DivID,StaffDetail.DeptID = Dept.DeptID,JoinDate>=' 2000-01-01' and JoinDate<=' 2000-01-02';

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    I am not familiar with MySQL specific syntax but my guess would be you will have to replace the commas with AND in your WHERE clause.


    select * from StaffDetail, Division, Dept where StaffID in ('1','2')
    AND StaffDetail.DivID = Division.DivID,StaffDetail.DeptID = Dept.DeptID
    AND
    JoinDate>=' 2000-01-01' and JoinDate<=' 2000-01-02';

  3. #3
    Join Date
    Feb 2003
    Posts
    4
    I have solve my problem.
    sorry to ask such stupid question!

  4. #4
    Join Date
    Feb 2003
    Location
    malaysia
    Posts
    3

    Unhappy something....

    what the meaning deptno.dept=dept.depno

Posting Permissions

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