[Solved] Setting a multifield constraint

Creating tables and queries
Post Reply
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

[Solved] Setting a multifield constraint

Post by gkick »

Hi,

How does one set a multi field constraint like
if debit is greater then 0 then credit is 0 and if credit is greater then 0 then debit is 0

Thanks
Last edited by gkick on Sat Sep 05, 2020 9:39 pm, edited 1 time in total.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Setting a multifield constraint

Post by Villeroy »

Code: Select all

alter table "foo" add constraint "blah" check "debit"=0 OR "credit"=0
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: Setting a multifield constraint

Post by gkick »

Thank you Villeroy
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
Post Reply