By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

Need to count distinct number of occurances in a non-normalizedfield

P: 1
I have a field that contains multiple values seperated by |*|

So the field looks like this name1|*|name2|*|name3

I need to count how many unique,or distinct name are in that field and return a total number. So, the above example would return 3 total names.

So by way of continuing explanation:
If the first row contained: name1|*|name2
The second row contained: name1|*|name2
The resulting querry would return a total of 2 distinct names.

Hope this makes sense and I HOPE someone can help me.

I know this isn't normalized but it is the database I was dealt.

Nov 17 '11 #1
Share this Question
Share on Google+
1 Reply

P: 1,059
first of all I dont think mysql has any function that would let you break a string into small pieces.

how about using other programming language like C or php.

if it is php, then its very easy but if it is C then possible but not easy..
Nov 21 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.