How to find duplicate email address using mysql query

Some point in the future, you’ll have to get rid of some duplicated email records in your database table. How will you do that? Well, here is a handy query for finding duplicates of any field in a table. Suppose you want to find all email addresses in a table that exist more than once, use the query below: select email_address, count(email_address) as NumberOccurrences from table_user_info group by email_address having ( count(email_address) > 1 ); This query will give you the results below: email_address NumberOccurrences…

Continue reading »

MySQL Installation

After installing MySQL, go to MySQL directory on your pc, open the file my.ini and change the data directory where you’ll store all your data in the future.  By default, it’ll define your pc’s Documents directory as shown below. datadir=”C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/” However you can point it to Data directory under MySQL dir.

Continue reading »

Saturday March 21st from 9:00pm to 11:00pm PST

247Apps Scheduled Maintenance   We will be making some improvements to our servers to provide greater reliability and performance for our customers. From 9:00pm to 11:00pm PST, Saturday March 21st, we will be conducting some hardware upgrades to our servers. Services for software Elementor, Rental Plugins, Custom Calculation customers will be affected. While you may continue to work in open applications, you may experience an interruption to web services during the maintenance period. We apologize for any inconvenience this disruption may cause and thank you…

Continue reading »

Applying mathematics directly to database table

When your company decides to reduce the prices of all products to 5% during this difficult economic time, what will you do to adjust the product prices in your database. Here is what I will show you. If you perform the query directly to production database, first, I would recommend you duplicate the product table in case you enter an incorrect query. I always do this when I run query to change data in database. Then write you query UPDATE tbl_products SET price = price –…

Continue reading »

Concatenate 2 or more fields from a database table

If you want to get a result of firstname and lastname together as a single field, you will use CONCAT_WS(separator string, field1, field2,…) function. Here’s I will show you how. For example, a table name Manager has 4 fields and some records as shown below. id firstname lastname email_address 1 Linda Doe linda@mynetworksolutions.com 2 Didi Menita didi@yahoo.com 3 Jane Doe jane@adobe.com 4 Elisa Bethoni bethoni@microsft.com You will use the following query statement to produce the expected result as shown below. SELECT id, CONCAT_WS(‘ ‘,firstname,lastname) AS…

Continue reading »