Query in DB2

I need to write a query in DB2 to get  all the records in BALANCETABLE where the year_id is '2012', period_id is 0, and souce_id does NOT contain within the value 'abc123' .  My Statment looks like this:    

SELECT * FROM "BALANCETABLE" where  year_ID = '2012' and period_ID = 0 and souceinterid NOT like 'VDB193' ;

What am i doing wrong here
Steve SamsonAsked:
Who is Participating?
Kent OlsenData Warehouse Architect / DBACommented:

Hi cutler,

You need to include one or more "wild cards" in the string

Find all items starting with the string:

  LIKE 'VBD193%'

Find all items ending with the string:

  LIKE '%VBD193'

Find all items containing the string:

  LIKE '%VBD193%'

Good Luck,
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.