Skip to content
  • Home
  • News
  • Sample Code
  • How To
  • Tutorial
  • Assignment Help!

Student Assignment Help

Assignment Solution @ Assignment Help on Fiverr.com

  • Home
  • News
  • Sample Code
    • C/C++ Sample Code
      • C in Linux
        • Linux Kernel Module
      • C in Windows
    • Java Sample Code
    • Python Sample Code
    • New Jersey Standard ML (SML/NJ)
    • Oracle Sample Code
    • Database Analysis and Design Sample
  • How To
    • HTML-XML-CSS
    • Java
    • MySQL
    • Oracle
    • Linux RedHat
  • Tutorial
    • System Analysis and Design
    • Data Flow Diagram DFD
    • Database Analysis and Design
    • C/C++ Language
    • WordPress
      • WordPress Basic
      • WordPress Security
  • Assignment Help!

Oracle Select Distinct with One or More Columns

Posted on 2018-04-042018-04-04 By Presto Bear

1.To select distinct result for a specific column, we use the command:
select distinct(col1) from table1;
For example: select distinct(studentid) from student;

2.If we want to select distinct with more than one column, we can use the command:
select distinct col1, col2, col3 from table1;
For example: select distinct studentid, name, address from student;

3.If in a VIEW, for some reasons, contain duplicate rows. It means that there are rows that 100% match to each other in a View. If we want the select command to show duplicate rows just one time, we can use the command:
select distinct * from table1;
The command will let duplicate rows shown only one time.

4.If we have a TABLE, and this table contain duplicate rows. And, we want to delete duplicate rows by some of criteria columns, we can use the command:
DELETE FROM T_TB1 WHERE rowid not in (SELECT MIN(rowid) FROM T_TB1 GROUP BY C_C1, C_C2, C_C3);
***C_C1, C_C2, C_C3: list of columns that form a criteria/condition
More Info ……..

5.If we join two tables in a select command, and in the results contain duplicate rows. If we want to refine the result with a distinct column as criteria only, we can use the command:
select distinct(table1.column1), table2.* from table1, table2 where table1.column2=table2.column3;

Assignment Help!!!
Oracle Tags:oracle distinct, select distinct, table duplicate row, view duiplicate row

Post navigation

Previous Post: [SOLVED] Could not find this item. This is no longer located
Next Post: Java Get Next/Previous Month or Year
Assignment Help!!!

Key Posts

  • Chapter 5 – Crow’s Foot Notation
  • [SOLVED] Could not find this item. This is no longer located
  • Linux command to get Tomcat PID
  • Case Study: Entity Relationship Diagram (ERD) for Student Registration System
  • Sample Java Program for Triangle
Assignment Help!!!

Recent Posts

  • Windows 10: How to start Command Prompt as Admin and Terminate a process
  • Java How to Trust all Email Server
  • [Solved]: Windows 10 100% Disk Usage
  • Weddings, Parties, Everything Catering Services System
  • CSC/CPE 3350 Lab 4 Part 1 – Recursive File Search
  • Zayed University
  • Kitchen Gadgets
  • Food Ordering System
  • Investment bank XYZ Ltd
  • CSC/CPE 3350 Lab 3 – The Falcon Shell
  • CSC/CPE 3350 Lab 2
  • Analyzing Cost and Benefit: Campus Bikes
  • Emirates Top Auto Parts
  • Sports News
  • Workington Council
Assignment Help!!!

Copyright © 2022 Student Assignment Help.