Dear All,
Suppose you have a query given below:
SELECT ud.email FROM user_detail ud group by ud.email having count(ud.email) > 1;
The above query return all email addresses which are duplicate in the system.
Now go to server and type following:
## Fetching duplicate email address and saving them into file...
mysql -uuser_name -p -hhost_name -A -Ddatabase_name -B --skip-column-names -e "SELECT ud.user_id, ud.email FROM user_detail ud group by ud.email having count(ud.email) > 1;"> /var/www/duplicateEmail
"/var/www/" is a path where you want to save file.
"duplicateEmail" is a file name.
Cheers!
Suppose you have a query given below:
SELECT ud.email FROM user_detail ud group by ud.email having count(ud.email) > 1;
The above query return all email addresses which are duplicate in the system.
Now go to server and type following:
## Fetching duplicate email address and saving them into file...
mysql -uuser_name -p -hhost_name -A -Ddatabase_name -B --skip-column-names -e "SELECT ud.user_id, ud.email FROM user_detail ud group by ud.email having count(ud.email) > 1;"> /var/www/duplicateEmail
"/var/www/" is a path where you want to save file.
"duplicateEmail" is a file name.
Cheers!
Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!
ReplyDeletePHP Mysql Developers in India