Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

api.moorages_stays_view

Description

Moorages stay listing web view

Table Definition
CREATE VIEW moorages_stays_view AS (
 SELECT _to.name AS _to_name,
    _to.id AS _to_id,
    _to._to_time,
    _from.id AS _from_id,
    _from.name AS _from_name,
    _from._from_time,
    s.stay_code,
    s.duration,
    m.id,
    m.name
   FROM api.stays_at sa,
    api.moorages m,
    ((api.stays s
     LEFT JOIN api.logbook _from ON ((_from._from_time = s.departed)))
     LEFT JOIN api.logbook _to ON ((_to._to_time = s.arrived)))
  WHERE ((s.departed IS NOT NULL) AND (s.name IS NOT NULL) AND (s.stay_code = sa.stay_code) AND (s.moorage_id = m.id))
  ORDER BY _to._to_time DESC
)

Columns

NameTypeDefaultNullable
_from_idintegertrue
_from_nametexttrue
_from_timetimestamp with time zonetrue
_to_idintegertrue
_to_nametexttrue
_to_timetimestamp with time zonetrue
durationintervaltrue
idintegertrue
nametexttrue
stay_codeintegertrue

Referenced Tables

NameColumnsCommentType
api.stays_at2Stay TypeBASE TABLE
api.logbook42Stores generated logbookBASE TABLE

Relations

erDiagram


"api.moorages_stays_view" {
  integer _from_id ""
  text _from_name ""
  timestamp_with_time_zone _from_time ""
  integer _to_id ""
  text _to_name ""
  timestamp_with_time_zone _to_time ""
  interval duration ""
  integer id ""
  text name ""
  integer stay_code ""
}

Generated by tbls