SQL clause to list specific matching string parts

Completed Posted Mar 22, 2013 Paid on delivery
Completed Paid on delivery

I have a MySQL table with fields email (varchar 255) and country (varchar 2). Email field holds an email address of the user and the country field holds his country, as represented by two character country code.

Lets consider this clause:

SELECT DISTINCT SUBSTRING_INDEX(email,'@',-1) FROM `table` WHERE country = "DE"

It lists all the domains of users from country code 'DE'. I need an SQL clause similar to this, except that it will only lists domains of whose users more than 95% are from the country code 'DE'. In other words, if 96% of users of '[url removed, login to view]' are from country code 'DE', then the output must contain '[url removed, login to view]', but if there are millions of users from 'DE' that use domain '[url removed, login to view]', but they do not represent over 95% of the all users of '[url removed, login to view]', then '[url removed, login to view]' is not listed in the output.

The idea is to output a list of email domains whose users are *most likely* from a specific country code (= 'DE')

MySQL

Project ID: #4358701

About the project

3 proposals Remote project Active Mar 22, 2013

Awarded to:

ashispradhanoec

As i am a Database Developer and new to freelancing i have lot of expectation and confident to deliver most stable work. it will take less then a day to deliver your aim.

$35 USD in 0 days
(1 Review)
1.1

3 freelancers are bidding on average $42 for this job

huyit

Hi there, Please give me the database. I will give you the script. Ready to start right now. Kindly view PMB to further information about me. Thanks

$50 USD in 1 day
(5 Reviews)
3.0
gyk

Hello. I will create a sql script tonight if you post a database.

$40 USD in 1 day
(1 Review)
2.0
kartikkshah

My self Kartik Shah I have over 6 years experience to work in the web technologies and software field. I have experience to Work on: php, mysql, LAMP, ajax, jquery, json, javascript, xml, html, css, webserviecs wi More

$30 USD in 0 days
(2 Reviews)
2.0