Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to add a case statement on a sql on a dataobject


Go to End


1107 Views

Avatar
doublecheese

Community Member, 5 Posts

29 August 2016 at 9:36am

Hi,

How do i modify/add a case statement like below to my dataobject :

CASE WHEN MyClass.ClassName IS NOT NULL THEN MyClass.ClassName ELSE 'FOO' END AS RecordClassName