Jump to content

subselect with wildcard


balikian
 Share

Recommended Posts

I've got one table with with an compID, say "12345". I need to query another table which has a compCode with values based on the compID of the other table, so something like:12345_112345_212345_312345_4So I want to do something like:select * from TABLE where compCode like '(select compID from FIRSTTABLE where ID = '99999')%'But this doesn't work. Basically, I want to add a wildcard (%) to the end of a subselect. Is this possible? I've dug through all my books and can't find it. I'm fairly new to SQL. So there must be another way to do this. Thanks.scottp.s. this is my first time posting to this forum and one dealing with SQL, so hopefully I've explained what I am doing properly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...