mysql - Extract rows using select query -


i have 2 queries shown below.

 select *  `nhrd_members` b  membership_number 'a%'  , `member_fromdate` >= '2014-01-01'  , `member_fromdate` <= '2015-01-01' 

which yields 98 rows..

 select *  `nhrd_members`  membership_number 'a%'  , `member_fromdate` >= '2014-01-01'  , `member_fromdate` <= '2014-05-14'  

which yields 19 rows.

as can see extracting data same table. actual result need 98-19 i.e 79 rows.

i need exclude rows of query 2 query 1. , 81 records. appreciated.

select * `nhrd_members` b   membership_number 'a%'   , (     `member_fromdate` >= '2014-01-01'     , `member_fromdate` <= '2015-01-01'   )   , not (     `member_fromdate` >= '2014-01-01'     , `member_fromdate` <= '2014-05-14'   ) 

that can simplified as:

select * `nhrd_members` b   membership_number 'a%'   , (     `member_fromdate` > '2014-05-14'     , `member_fromdate` <= '2015-01-01'   ) 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -