skip to Main Content

validate a numeric column postgres – Postgresql

im trying to validate a column using postgresql where values in the column are (0000-ASZAS) four numerical values-five alphbets SELECT invoice_number, CASE WHEN invoice_number = '[0-9][0-9][0-9][0-9]-[A-Z][A-Z][A-Z][A-Z][A-Z]' THEN 'valid' ELSE 'invalid' END from invoices; also tried LIKE instead of = sorry…

VIEW QUESTION

Sum over a given time period – Postgresql

The following codes gives the total duration that a light has been switched on. CREATE TABLE switch_times ( id SERIAL PRIMARY KEY, is1 BOOLEAN, id_dec INTEGER, label TEXT, ts TIMESTAMP WITH TIME ZONE default current_timestamp ); CREATE VIEW makecount AS…

VIEW QUESTION
Back To Top
Search