July 2, 2012 at 3:48 pm
We have a table with School range Program defined in each school and grade level.
At beginning we use RangCd like 9-12, K-5, but later for some of them we closed the program and open the program with RangeCd separately in each grade, like 09, 10, 11, 12.
So now in application code side, because of the duplicate, it caused some issue.
They want to remove those duplicated records that in a range like 9-12, and keep others with separate grade levels.
The hard part for me is not knowing how to compare the RangCd column, because some of it are range, some are only one grade level.
I attached the table, and some sample data.
The final purpose is to delete those records with rangeCode like %-% that are already exist in the form of each grade level.
.
July 2, 2012 at 3:51 pm
Not sure about others, but when I viewed your attachment, it is all run together. I'm not about to run this code on my computers when I can't even tell what is what.
July 2, 2012 at 3:53 pm
Sorry, for some reason when I save from .sql to .txt, it changes the format.
i will try to attach it again.
July 2, 2012 at 3:58 pm
I will reload them
July 2, 2012 at 4:01 pm
Reload the script
July 2, 2012 at 4:04 pm
Here is something that could help you write a query to dedupe your data
http://jasonbrimhall.info/2011/03/21/dedupe-data-cte/
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
July 2, 2012 at 4:06 pm
For my case, the hard part is I would like to compare the rangeCd that is a range, and separate grade level and make them not duplicate
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply