if !NULL ?

From: Lev Lvovsky <lists1(at)sonous(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: if !NULL ?
Date: 2002-05-16 23:40:51
Message-ID: Pine.LNX.4.43.0205161625260.6216-100000@ground0.sonous.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


ok, so more odd-ball questions

I have two columns in a table:

bool_bill | billing_id

one is a boolean that determines if we bill a customer, and the other one
is NULL if we don't, and has a billing_id of that customer if we do. the
billing_id uses a foreign key on the billing table to check that the
billing_id exists.

what I'd like to do is if bool_bill = y, then there has to be something in
billing_id (automatically checked with the foreign key).

again, do I need a function for this?

thanks!!!

-lev

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2002-05-16 23:41:05 Re: simple yet complex join
Previous Message Vincent Stoessel 2002-05-16 23:26:01 simple yet complex join