Strange sql results

  • My select statement:

    SELECT DISTINCT CM.ID,NAME1,PHONE,CITY,STATE,QUALIFIED_EQUIP,INSURANCE_EXP,INSURANCE_EXP2,INSURANCE_AMT FROM CONTRACTOR_MASTER CM INNER JOIN CONTRACTOR_DRIVER_PROFILE CDP ON CM.ID = CDP.CONTRACTOR_ID UNNEST QUALIFIED_EQUIP WHERE (CM.STATE ='PA' AND CDP.CONT_TYPE = 7 AND CDP.BROKER < 21185 AND CDP.CANCEL_DATE < CDP.CONTRACT_DATE AND INSURANCE_AMT >= 100000 AND INSURANCE_EXP_NC > TODAY_NC AND INSURANCE_EXP2 > TODAY_NC) AND (QUALIFIED_EQUIP = 'C') ORDER BY NAME1

    This select statement works but for some reason its pulling back the results for ALL states and not a specified state and I can't seem to figure out why its not. I am going to guess because of the multivalue but I am not sure.

    Matt

  • UNNEST is right now an unused keyword in T-SQL. Maybe you are talking about PL-SQL?

    Edited by - hanslindgren on 03/31/2003 09:47:47 AM

  • nope its not PL-SQL. It's UniSQL. It's the sql you use to access Unidata databases. I was just seeing if there was a problem with my where to cause this but I have a feeling I am going to have to do some programming to get only the state I want.

    Just for your information UNNEST does exist in t-sql if you use OLAP.

    Matt

  • Ahh. Thank you 🙂

    You learn something new everyday.

    Regards, Hanslindgren!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply