In my request, I have an IF statement:
IF(friend.block, 'yes', 'no')
where the value of friend.block is 0 or 1 .. but in any case put it “yes” .. any idea?
Syntax:
IF (friend.block = 1) THEN 'Yes' ELSE 'No' END IF
You can use the case statement:
CASE friend.block WHEN 1 THEN "Yes" WHEN 0 THEN "NO" END
friend.blockmust have a type INTEGERfor this, or you need to put a companion there:
friend.block
INTEGER
IF(friend.block != 0, 'yes', 'no')
CASE friend.block WHEN 1 THEN 'yes' WHEN 0 THEN 'no' END
Source: https://habr.com/ru/post/1719877/More articles:Самый эффективный способ добавления новых ключей или добавления старых ключей в словарь во время итерации в Python? - pythonVisual Studio - a tool to replace hard-coded strings with resources - stringNew OVI SDK for Symbian - symbianHow to check application startup time or performance - performanceHow to debug NHibernate mapping? - debuggingMantis - add version field - fieldPrimitive MailMerge using only limited field names - ms-wordHow to open partial view using jQuery modal popup in asp.net MVC? - jqueryФункция веб-приложения не активирована по умолчанию - web-applicationsDate format for django SelectDateWidget - djangoAll Articles