sql removing multiple records with mutltiple date values
I have the following sample data that I need to clean the records by
specific date. For this example, lets use anything older than march 2012
will need to be removed along with other related records.
Author Book date
-------------------------------------
Smith Bk1 01/01/2012
Smith Bk2 02/01/2012
Smith Bk3 02/25/2012
Johnson Bk1 06/01/2011
Johnson Bk2 09/01/2011
Johnson Bk3 03/01/2012
Johnson Bk4 01/01/2013
Jones BK1 01/01/2001
Jones BK2 01/01/2002
Jones BK3 01/01/2009
Jones BK4 08/01/2013
Above is the data set. So if the Author has a book in the table that is
older than 03/01/2013, then All of the records need to be removed. If they
have at least one Book newer than the date specified then All records are
kept. In this scenario, the Jones records are the only ones to be kept in
the table data set.
Thanks for any help, I appreciate it.
No comments:
Post a Comment