On Saturday 01 July 2006 03:41, Richard Broersma Jr wrote:
> > > CHECK ( 1 = ALL ( SELECT COUNT(STATUS)
> > > FROM BADGES
> > > WHERE STATUS = 'A'
> > > GROUP BY EMPNO))
> >
> > From the P
> This is more of an implementation option, but when I worry about what is
> active/inactive I put start/end dates on the tables. Then you don't need
> active indicators. You just look for the record where now() is >= start
> date and now() <= end date or end date is null. You can even
> activat
> On Fri, 2006-06-30 at 18:41 -0700, Richard Broersma Jr wrote:
> > > > CHECK ( 1 = ALL ( SELECT COUNT(STATUS)
> > > > FROM BADGES
> > > > WHERE STATUS = 'A'
> > > > GROUP BY EMPNO))
> > >
This is more of an implementation option, but when I worry about what is active/inactive I put start/end dates on the tables. Then you don't need active indicators. You just look for the record where now() is >= start date and now() <= end date or end date is null. You can even activate/deactiva
On Fri, 2006-06-30 at 18:41 -0700, Richard Broersma Jr wrote:
> > > CHECK ( 1 = ALL ( SELECT COUNT(STATUS)
> > > FROM BADGES
> > > WHERE STATUS = 'A'
> > > GROUP BY EMPNO))
> >
> > From t
Richard Broersma Jr wrote:
But now that I think about it, using the authors suggestion (if it actually
worked), how would
would it be possible to change the active status from one badge to another?
Well, the check constraint as you wrote it requires that there always be
a badge listed as act
> > The following codes doesn't work on PostgreSQL 8.1.4 but according to
> > the book does conform to SQL-92.
>
> > CHECK ( 1 = ALL ( SELECT COUNT(STATUS)
> > FROM BADGES
> > WHERE STATUS = 'A'
> >
Richard Broersma Jr <[EMAIL PROTECTED]> writes:
> The following codes doesn't work on PostgreSQL 8.1.4 but according to
> the book does conform to SQL-92.
> CHECK ( 1 = ALL ( SELECT COUNT(STATUS)
> FROM BADGES
> WHERE ST
> > CHECK ( 1 = ALL ( SELECT COUNT(STATUS)
> > FROM BADGES
> > WHERE STATUS = 'A'
> > GROUP BY EMPNO))
>
> From the PostgreSQL docs (http://www.postgresql.org/docs/8.1/
> interactive/sql
On Jul 1, 2006, at 6:55 , Richard Broersma Jr wrote:
CHECK ( 1 = ALL ( SELECT COUNT(STATUS)
FROM BADGES
WHERE STATUS = 'A'
GROUP BY EMPNO))
From the PostgreSQL docs (http://www.postgr
10 matches
Mail list logo