Answered by:
SQL Query

Question
-
I am trying to develop an SQL query like that :
UPDATE Query1 SET Query1.type = Switch(type Like 'sh*' Or 'katastima','shop',type Like 'ipi*','services',type Like 'ka*','cafe',type Like 'TE*' Or 'ktiria tepak','tepak',type Like 'per*','kiosk',type Like 'esti*','restaurant',type Like 'farm*' Or 'Farm','pharmacy');
But my data doesn't change as i want. Could anyone make a suggestion?
Wednesday, March 23, 2016 11:06 PM
Answers
-
Hi. When you have more than one condition to check, you'll need to have both sides of the comparison for each condition. For example, if you want to check if Type starts with "sh" or if it is equal to "katastima," then you would use something like:
[type] Like 'sh*' Or [type]='katastima'
Hope that helps...
- Proposed as answer by André Santo Thursday, March 24, 2016 11:23 AM
- Marked as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, April 1, 2016 10:26 AM
Thursday, March 24, 2016 12:56 AM -
Hi, Marios Simou
from your query its looks like you are matching a case in 2 languages. so if user spell like any of one that case should executed and set the value. but you have to match it correctly. because it is possible that user give some input but your code doesn't have that criteria to match at that time you will not get the proper output. so make your code that match your criteria thoroughly.
for more reference please visit the link below.
Access wildcard character reference
Regards
Deepak
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, April 1, 2016 10:26 AM
- Marked as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, April 1, 2016 10:26 AM
Friday, March 25, 2016 6:01 AM
All replies
-
Hi. When you have more than one condition to check, you'll need to have both sides of the comparison for each condition. For example, if you want to check if Type starts with "sh" or if it is equal to "katastima," then you would use something like:
[type] Like 'sh*' Or [type]='katastima'
Hope that helps...
- Proposed as answer by André Santo Thursday, March 24, 2016 11:23 AM
- Marked as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, April 1, 2016 10:26 AM
Thursday, March 24, 2016 12:56 AM -
Hi, Marios Simou
from your query its looks like you are matching a case in 2 languages. so if user spell like any of one that case should executed and set the value. but you have to match it correctly. because it is possible that user give some input but your code doesn't have that criteria to match at that time you will not get the proper output. so make your code that match your criteria thoroughly.
for more reference please visit the link below.
Access wildcard character reference
Regards
Deepak
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, April 1, 2016 10:26 AM
- Marked as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Friday, April 1, 2016 10:26 AM
Friday, March 25, 2016 6:01 AM