Wednesday, January 27, 2010

SQL error that needs some feedback

count of column list and variable list do not match

We are getting this error on one of our queries and I am not sure how to approach a solution.  Any suggestions from the class?

3 comments:

  1. Add your query and the involved tables to the discussion.

    ReplyDelete
  2. SELECT NURSE.FNAME, NURSE.LNAME
    from NURSE
    WHERE NURSE.ID in
    (SELECT a.EMP_RECORD_ID, a.HOSPITALID, a.NURSEID, a.BEGDATE, a.ENDDATE, a.HOSPITALROLE
    FROM EMPLOYMENTDATA a
    WHERE a.ENDDATE is NULL)
    EMPLOYMENTDATA
    EMP_RECORD_ID Integer not null
    HOSPITALID Integer not null
    NURSEID Integer not null
    BEGDATE Varchar(10) not null
    ENDDATE Varchar(10)
    HOSPITALROLE Integer not null


    NURSE
    ID Integer not null
    FNAME Varchar(25) not null
    LNAME Varchar(25) not null
    STREETADDRESS Varchar(25) not null
    CREDENTIALID Integer not null
    ZIPCODE Integer not null
    PHONE Varchar(12) not null

    ReplyDelete
  3. EMPLOYMENTDATA
    EMP_RECORD_ID Integer not null
    HOSPITALID Integer not null
    NURSEID Integer not null
    BEGDATE Varchar(10) not null
    ENDDATE Varchar(10)
    HOSPITALROLE Integer not null

    ReplyDelete