468,514 Members | 1,381 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

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

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
1 1423
1,059 1GB
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.

Similar topics

reply views Thread by puskas | last post: by
1 post views Thread by jerry.ranch | last post: by
4 posts views Thread by tom booster | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.