Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
These two lines add an index for faster regex matching, look up pg_trgm in the docs for more details. It works with provided dataset but there is a downside for searching like this. For example, if a prospect named
Annabelle Smith
exists and I need to findAnna Smith
then the query will return a false positive.What are the first two lines doing here? It seems like the customers <--> prospects join is just done on the prospect name containing both the first name and last name so I don't see what you're doing with the first two lines?
There is no need for the last line with ORDER BY here - window function orders the data.
I have the same issue as thurstonzd. I've found the answer wanted, but still don't get why it's accepted.
For example:
"2018-09-11 07:17:57" - "2018-09-14 07:17:57"
"2018-09-12 07:17:57" - "2018-09-16 07:17:57"
these visits do not overlap according to accepted conditions. Why?