Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use sql % syntax
Message
 
 
To
13/10/2009 10:26:31
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01429124
Message ID:
01429140
Views:
52
>>>>Try
>>>>
>>>>
?SQLEXEC(lnHandle,"select top 1 ac from account where ac like '%'+?mytext+'%' order by ac desc limit 1","tmp")
>>>
>>>Doesn't look right to me
>>>
>>>
>>>>Top 1 to get the only one last record matching the criteria.
>>
>>I guess you're suggesting that I should actually try it. Give me a sec. then - in any case it's better than version Tracy posted - which is opened to SQL injection attacks.
>
>Well it cannot be better if it doesn't work

I was updating my reply and then I noticed it has Limit 1 at the end - which indicates it's a MySQL syntax. We had troubles getting it to work with Rich in another similar thread recently.

I know for sure that

"select top 1 Ac from Account where ac like '%' + @Ac + '%' order by Ac DESC" works in SQL Server.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform