473,394 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Really REALLY simple question (I think)

I'm sure I used to know this but can't find it anywhere in my dusty mind.

How do you stop repeating data in a sql*Plus report?

e.g.

Select d.dname, e.emp_name
from emp e, dept d
where d.dept_id = e.dept_id

DNAME EMP_NAME
Boston Larry
Bill
Mark
D.C. Condoleeza
Dubya
Must be possible mustn't it? I thought it was SKIP or something to tell sqlplus to not repeat but I can't figure it out.
Jun 28 '06 #1
4 1556
Aww cr@p it was simple.... just in case anyone else is having amnesia...

It's the Break command in sql*plus :)
Jun 28 '06 #2
use keyword 'distinct'
Jul 7 '06 #3
don't need to user DISTINCT like keyword. there mustn't proper joing apllied in qry. thats why data redundancy appeared. plesae check the primary keys of both the tables and apply criteria, else use Group By

i.e.

Select A.Tab1, B.Tab1, C.Tab1, A.Tab2, B,Tab2, C.Tab2, D.Tab2
Where A.Tab1 = A.Tab2 And B.Tab1 = B.Tab2
Group By A.Tab1, B.Tab1, C.Tab1, A.Tab2, B,Tab2, C.Tab2, D.Tab2

in the above example, A, B are considered as PK.

Mahesh
Jul 31 '06 #4
masdi2t
37
e.g.

Select d.dname, e.emp_name
from emp e, dept d
where d.dept_id = e.dept_id

DNAME EMP_NAME
Boston Larry
Bill
Mark
D.C. Condoleeza
Dubya
Must be possible mustn't it? I thought it was SKIP or something to tell sqlplus to not repeat but I can't figure it out.
Yes, i think it's a Break command.
try this command before your SELECT statement

SQL> break on dname duplicates

thus command tell SQL*Plus to print duplicate value(s), for more information, feel free to type help break on SQL*Plus command window
Aug 3 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

86
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
1
by: dpsol | last post by:
I have been trying the whole day to insert a table within an existing table in a Word document. I can not figured it out! Please help me..... : ( Public Class Form1 Private Sub...
2
by: Evan | last post by:
Hey, I posted this yesterday, but no one had any ideas? C'mon now, I know this isn't that hard, i'm just a little new to javascript, and I can't quite figure this out. I searched and searched to...
0
by: CptDondo | last post by:
I have a website that is generated on the fly from XML templates. I've been having some performance issues (pages taking 6 seconds or more to be generated) and profiled the php code. (This is an...
5
by: Victor Reboucas | last post by:
Hi, I'm sure I'm missing something here, but.... I have a asp.net 2.0 web form and a calendar control. If I set the selectedDate clicking the control, no problem, but, if I set it using code I...
8
by: =?Utf-8?B?TFc=?= | last post by:
Hello! I am just learning about forms authentication so please excuse this basic question. I am using .NET 1.1 and C#. I have created my web.config file and my login.aspx and the associated cs...
10
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports...
5
by: BURL ives | last post by:
I am well versed in MS Access. I now want to set up a SQL database on my company's server. However there are some pretty basic questions that I have starting out...I did a bit of searching but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.