Hi Everyone! Please forgive my ignorance - I am a ColdFusion programmer who does not know much about databases and is trying to incorporate MySQL into my programming with not much luck.
I have a field in my db that is a list of numbers. ("1,13,9,47" etc.) What I want to do is write a select query and take the last number in the list to query against (do I make any sense??)
Here's what my code looks like:
select * from templates
where numberlist = 47
This doesn't work, of course, because the value for numberlist is "1,13,9,47", so it doesn't match. I want to access the LAST number in the list - is there a syntax to do that? In Coldfusion it's as easy as #ListLast(numberlist)# (this would return the value 47) - I'm hoping it's this easy in SQL too.
Thanks in advance!!!
I have a field in my db that is a list of numbers. ("1,13,9,47" etc.) What I want to do is write a select query and take the last number in the list to query against (do I make any sense??)
Here's what my code looks like:
select * from templates
where numberlist = 47
This doesn't work, of course, because the value for numberlist is "1,13,9,47", so it doesn't match. I want to access the LAST number in the list - is there a syntax to do that? In Coldfusion it's as easy as #ListLast(numberlist)# (this would return the value 47) - I'm hoping it's this easy in SQL too.
Thanks in advance!!!