Monday, October 28, 2013

SQL query

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.










































































































PersonActionDateflag
MaxSale20/07/2010Y
MaxSale26/10/2010N
MaxSale3/11/2010N
MaxSale1/04/2011N
MaxNo Sale28/05/2011Y
MaxSale13/06/2011Y
MaxSale11/07/2011N
MaxSale19/08/2011N
MaxNo Sale1/10/2011N
MaxNo Sale9/12/2011Y
MaxSale1/02/2012Y
MaxNo Sale1/02/2012Y
MaxSale7/02/2012Y
MaxSale13/02/2012N
MaxNo Sale6/07/2013Y

Essential I should be able to run a code that will get me the following results:
































































PersonActionDateflag
MaxSale20/07/2010Y
MaxNo Sale28/05/2011Y
MaxSale13/06/2011Y
MaxNo Sale9/12/2011Y
MaxSale1/02/2012Y
MaxNo Sale1/02/2012Y
MaxSale7/02/2012Y
MaxNo Sale6/07/2013Y

Hopefully that makes sense.


Thanks


No comments:

Post a Comment