[sql] How do I use select with date condition?