Skip to content

molecularsciences.org

Simply Explaining Technology

  • Articles
    • bash
    • Drupal
    • Java
    • Linux
    • Mac OS
    • PHP
    • Python
    • Quick Introduction
      • Amazon Cloud
      • BioPerl
      • Data Science
        • Apache Spark
        • Hive
      • Java Programming
      • JSON
      • MongoDB
      • JavaScript
        • gulp.js
        • Laravel 5
        • Node.js
      • WordPress
      • XML
  • Special Topics
    • Reference
    • Design Patterns
    • installation guide
    • Optimization
  • Topics
    • Architecture
    • cloud
      • AWS Amazon Web Services
    • CMS Content Management System
      • Drupal
      • WordPress
    • Database
      • MySQL
      • Oracle
    • Programming
      • bash
      • Java
      • PHP
      • Python
    • Linux
    • Science

Finding duplicate values in a MySQL database

#Database, #MySQL
Views: 13

In the following query, we list all lastname held by 2 or more employees.

SELECT lastname, COUNT(*) c FROM employees GROUP BY lastname HAVING c > 1;

If you want a value to be unique, you should add a unique constraint to the column. However, you would from time to time have to deal with a badly designed database. In such cases, this query will come in handy.

Post navigation

How to reset MySQL root password
ORA-01858: a non-numeric character was found where a numeric was expected

Related Post

Oracle SQL Error Cheat Sheet: Common Errors and Fixes

Solving ORA-00936: Missing expression

Solving ORA-00932: Inconsistent datatypes: expected “type1” but got “type2”

Advertisement
Topics
Architecture Artificial Intelligence AWS Amazon Web Services bash cloud copilot Database Data Science Drupal Java JavaScript Linux Mac OS Microsoft Excel Microsoft Office Microsoft Windows Miscellaneous MySQL Oracle PHP Programming Python Q&A Reference Science Statistics Uncategorized WordPress
Tags

AI Amazon EBS Amazon S3 Apache architecture Availability Zones AWS Amazon Web Services bash Bioinformatics Cloud cloud computing command line tips crispr Database Design Patterns Drupal EFS Elastic File System ELB Elastic Load Balancer file management installation guide Java JavaScript JSON Linux Mac OS Microsoft Excel Microsoft Windows ML MySQL Networking Optimization Oracle Perl PHP PL/SQL Programming Python SciPy ssh statistics string manipulation vagrant versioning wordpress xml

You missed

Database Oracle

Oracle SQL Error Cheat Sheet: Common Errors and Fixes

Python Science

JSON, XML, and YAML for Scientists: Data Formats Explained Simply

Science

CRISPR Under the Microscope: Understanding the Risks, Ethics, and Regulation of Gene Editing

AWS Amazon Web Services cloud

Azure vs AWS Certifications in Canada: A Complete Guide for 2025

molecularsciences.org

Simply Explaining Technology

Proudly powered by WordPress | Theme: Newsup by Themeansar.

  • Home
  • Blog
  • Sample Page