sam86 Posted April 25, 2014 Report Posted April 25, 2014 xml lo duplicate values ela extract cheyyali
150bryant Posted April 25, 2014 Report Posted April 25, 2014 how big is the xml file ? how many records.. i can only tell how to identify...but dont know how to remove
Spartan Posted April 25, 2014 Report Posted April 25, 2014 http://www.olcot.co.uk/sql-blogs/using-xquery-to-remove-duplicate-values-or-duplicate-nodes-from-an-xml-instance
150bryant Posted April 25, 2014 Report Posted April 25, 2014 http://stackoverflow.com/questions/19042829/find-the-duplicates-in-the-xml-column
sam86 Posted April 25, 2014 Author Report Posted April 25, 2014 I don't want to remove but I need the values. From query
sam86 Posted April 25, 2014 Author Report Posted April 25, 2014 Small xml two fields name same unnay how to extract values for both of them
150bryant Posted April 25, 2014 Report Posted April 25, 2014 I don't want to remove but I need the values. From query query dont know right click on grid form of xml file..copy as structured text.. then paste the same into excel. then find dups.. this will help if you are tryin to debug somethin
loveindia Posted April 25, 2014 Report Posted April 25, 2014 Post full requirements when u ask man... not half n half... see this.. DECLARE @xml XML = '<Address> <Details Person ="John" Country = "USA" /> <Details Person ="Mark" Country = "Australia" /> <Details Person ="Lynda" Country = "England" /> <Details Person ="Love" Country = "India" /> <Details Person ="Love" Country = "India" /> <Details Person ="Love" Country = "India" /> <Details Person ="Love" Country = "India" /> <Details Person ="Love" Country = "India" /> </Address>' ;WITH CTE AS ( SELECT A.value('@Person[1]', 'VARCHAR(20)') as Person , A.value('@Country[1]', 'VARCHAR(20)') as Country FROM @xml.nodes('Address/Details') AS A(A) ) SELECT Person, Country, Count(*) AS Cnt FROM CTE GROUP BY Person, Country I posted the same already at sqlsaga.com .. check the article if u want to... Group by kinda having count greater than 1 chestey u will get records with duplicates only...
MysorePak Posted April 25, 2014 Report Posted April 25, 2014 bhayya u just want to know the duplicate value or u need a query for that bec if u want as above copy xml as text and past in another xml then click on data format which will show you the duplicates values..
MysorePak Posted April 25, 2014 Report Posted April 25, 2014 if its oracle query this is what i know select column_name, count(column_name) from table group by column_name having count (column_name) > 1
powerstar02 Posted April 25, 2014 Report Posted April 25, 2014 Post full requirements when u ask man... not half n half... see this.. DECLARE @xml XML = '<Address> <Details Person ="John" Country = "USA" /> <Details Person ="Mark" Country = "Australia" /> <Details Person ="Lynda" Country = "England" /> <Details Person ="Love" Country = "India" /> <Details Person ="Love" Country = "India" /> <Details Person ="Love" Country = "India" /> <Details Person ="Love" Country = "India" /> <Details Person ="Love" Country = "India" /> </Address>' ;WITH CTE AS ( SELECT A.value('@Person[1]', 'VARCHAR(20)') as Person , A.value('@Country[1]', 'VARCHAR(20)') as Country FROM @xml.nodes('Address/Details') AS A(A) ) SELECT Person, Country, Count(*) AS Cnt FROM CTE GROUP BY Person, Country I posted the same already at sqlsaga.com .. check the article if u want to... Group by kinda having count greater than 1 chestey u will get records with duplicates only...:)
loveindia Posted April 26, 2014 Report Posted April 26, 2014 if its oracle query this is what i know select column_name, count(column_name) from table group by column_name having count (column_name) > 1 idi oracle code kaadu man, pure t-sql code... adi either oracle or sql server lo vaadukovachu...
Recommended Posts