Category: SQL

Get next purchase date for specific set of users

I have subscriptions table shown as below +———+————-+————+————+ | user_id | purchase_id | start_date | end_date | +———+————-+————+————+ | 1 | 1A | 2019-01-12 | 2019-01-22...

how can I make this query not CaSeSeNsITIVe?

how can I make this query not Case sensitive? @courses = Course.where(‘name LIKE ?’, “%#{params[:name]}%”) 2 Answers When you use a Postgres database then you might...

Count Since Last Max Within Window

I have been working on this query for most of the night, and just cannot get it to work. This is an addendum to this question....