skip to Main Content

Remove whitespaces after number – PostgreSQL

Basically, I want to remove the whitespace that exists after numbers Input: medication_title CLORIDRATO DE VENLAFAXINA 75 MG VIIBRYD 40 MG KTRIZ UNO 0.6 U/G Ouput: medication_title medication_title2 CLORIDRATO DE VENLAFAXINA 75 MG CLORIDRATO DE VENLAFAXINA 75MG VIIBRYD 40 MG…

VIEW QUESTION

Postgresql – Aggregate functions are not allowed in FILTER

I have this SQL query: SELECT users.id, users.name, users.avatar, MAX(messages.created_at) max_created_at, MAX(messages.body) FILTER (WHERE messages.created_at = MAX(messages.created_at)) last_message, CASE WHEN(COUNT(messages.is_read) FILTER (WHERE is_read = false AND messages.from_id != 14) = 0) THEN true ELSE false END is_read, COUNT(messages.is_read) FILTER (WHERE…

VIEW QUESTION
Back To Top
Search