Skip to content
Advertisement

Tag: postgresql

SQL query 2 limits

I have the following issue i want to limit on the total amount of items returned while limiting one value to a certain number I do a query like this Now I want to do the following, I have a field called running and I want to be able to say that in these results I want to have maximum

SQL Query for Events table

I have an event table in Postgres, with this structure: This works as a log, so all entries are immutable, change is status will be another INSERT. I want to efficiently extract all events which have status CREATED, but not DONE. Answer I assume that you want ITEMs that meet the conditions. If so: This uses the fact that ‘CREATED’

Advertisement