Avatar of NursingCorp
NursingCorp
Flag for United States of America

asked on 

Comparing 2 Columns of data with LIKE or CONTAINS

I have one table that has a column with a State in it and a second column with multiple states and need to join them:
i.e.
Table One Column                                     Table Two Column
State                                                          Desired States
---------------------                                        -----------------------
Arizona                                                       Arizona, California, Texas

How do I write the WHERE clause so that if the State in Table One State Column is also found in the Table Two Desired States Column?

SELECT data
FROM Table One
WHERE Table One.State IS LIKE Table Two.Desired State

Thanks,
Joe
SQL

Avatar of undefined
Last Comment
Guy Hengel [angelIII / a3]

8/22/2022 - Mon