Hi I currently have a table like below:
I need a sql script that will get me the all the records that have Y against them. Table will not contain FLAG column.
Person | Action | Date | flag |
Max | Sale | 20/07/2010 | Y |
Max | Sale | 26/10/2010 | N |
Max | Sale | 3/11/2010 | N |
Max | Sale | 1/04/2011 | N |
Max | No Sale | 28/05/2011 | Y |
Max | Sale | 13/06/2011 | Y |
Max | Sale | 11/07/2011 | N |
Max | Sale | 19/08/2011 | N |
Max | No Sale | 1/10/2011 | N |
Max | No Sale | 9/12/2011 | Y |
Max | Sale | 1/02/2012 | Y |
Max | No Sale | 1/02/2012 | Y |
Max | Sale | 7/02/2012 | Y |
Max | Sale | 13/02/2012 | N |
Max | No Sale | 6/07/2013 | Y |
Essential I should be able to run a code that will get me the following results:
Person | Action | Date | flag |
Max | Sale | 20/07/2010 | Y |
Max | No Sale | 28/05/2011 | Y |
Max | Sale | 13/06/2011 | Y |
Max | No Sale | 9/12/2011 | Y |
Max | Sale | 1/02/2012 | Y |
Max | No Sale | 1/02/2012 | Y |
Max | Sale | 7/02/2012 | Y |
Max | No Sale | 6/07/2013 | Y |
Hopefully that makes sense.
Thanks
No comments:
Post a Comment