awk script to remove duplicate rows in line

i have the long file more than one ns and www and mx in the line like .
i need the first ns record and first www and first mx from line .
the records are seperated with tthe ; i am try ing in awk scripting not getiing the solution.

NS,ns2.fastpark.net,216.8.177.29,windsor,on,can,-83.017,42.3;NS,ns1.fastpark.net,206.130.11.197,toronto,on,can,-79.443,43.751;WWW,www.0--00--0.com,216.8.179.24,windsor,on,can,-83.017,42.3

WW,www.0--5.com,63.251.171.80,vancouver,wa,usa,-122.728,45.681;WWW,www.0--5.com,63.251.171.81,vancouver,wa,usa,-122.728,45.681;WWW,www.0--5.com,66.150.161.136,vancouver,wa,usa,-122.728,45.681;WWW,www.0--5.com,66.150.161.140,vancouver,wa,usa,-122.728,45.681;WWW,www.0--5.com,66.150.161.141,vancouver,wa,usa,-122.728,45.681;WWW,www.0--5.com,69.25.27.170,vancouver,wa,usa,-122.728,45.681;WWW,www.0--5.com,69.25.27.173,vancouver,wa,usa,-122.728,45.681;MX,m1.dnsix.com,63.251.171.169,vancouver,wa,usa,-122.728,45.681

I need out put like these

NS,ns2.fastpark.net,216.8.177.29,windsor,on,can,-83.017,42.3;
WWW,www.0--00--0.com,216.8.179.24,windsor,on,can,-83.017,42.3

WW,www.0--5.com,63.251.171.80,vancouver,wa,usa,-122.728,45.681;
MX,m1.dnsix.com,63.251.171.169,vancouver,wa,usa,-122.728,45.681

#!/usr/bin/nawk -f
#/usr/xpg4/bin/awk -f
#/usr/bin/awk -f
 
BEGIN{ FS=";" }
{
split("",a); b=""
for(i=1;i<=NF;i++) {
  split($i,f,",")
  if (!a[f[1]]++) b=b?b";"$i:$i
  }
print b
}
 tr ';' '\n' < file| awk -F, '{if(!a[$1]) print $0;a[$1]=$0}'

-Devaraj Takhellambam

Another sol:

awk '! a[$1]++' FS="(;)|(,)" RS=';' filename

tks for quick reply