Skip to content
Advertisement

Tag: postgresql

Syntax for counting greater than and summing a value with multiple joins without the keyword having

I’m learning SQL (Postgres) and I’m slightly confused about something I’m trying to do. I have the following tables. Employee: Project: Department: And works_on: For this, I was trying to do something slightly more complex: To create a view that has project name, department name, number of employees, and total hours worked on each project that has the criteria of

check for same range in postgresql

I wanted to check if for one particular student my column (Amount) contains a value less than 10, and if yes, then check if for the same student my column (Amount) is also greater than 10 and update the column new accordingly in PostgreSQL. MY table: Tried this way but not working The output I’m expecting: Answer One option is

Advertisement