I have a players table which contains the following attributes
_id INTEGER PRIMARY KEY, name text not null,birth_date date not null
I want a query which can give me a l开发者_如何学Cist of all the players born in a particular month say May of 1986.
How could this be achieved? I tried using the date and time functions provided in SQLite but they were of no use.
Any pointers would be appreciated.
Thanks
SELECT p.name, p.birth_date
    FROM Player p
        WHERE p.birth_date > '1986-04-30'
            AND p.birth_date < '1986-06-01';
(untested)
I think this should work. I haven't tried it:
SELECT _id, name, birth_date 
FROM players 
WHERE strftime('%m',birth_date) = '05' AND  strftime('%Y',birth_date) = '1986'
SELECT p.name
     , p.birth_date
FROM Player p
WHERE p.birth_date >= '1986-05-01'
  AND p.birth_date < date('1986-05-01','+1 month') 
;
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论