Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 Table Join

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
SELECT MAX(version)
FROM files AS a, wos AS b
WHERE (((a.filename)='buildversion.txt')
And ((a.project)='$/Portal')
And b.wo=a.wo


Heres the problem, a.key is an int
b.fkeys is a string

I need a piece in my where that states a.key must be present in b.fkeys

b.fkeys has the format 'number,number,number,etc...'
any way to do this? I thought I could do this using a LIKE statement but my patience escapes me.

TiA,
-Tim
 
Some database vendors have functions that will allow you to do this. What database are you running?

I'll revisit this thread to see if anyone else knows how to do this in "ANSI" SQL.
 
Well, I got it working, it turns out it was an M$-ism. You can use the LIKE statement but you can't use TO_CHAR to convert it you have to use their CSTR() and then all is well. It not the prettiest and it is prone to a low error percent but for my needs it should be good.

-Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top