Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old November 21st, 2003, 04:47 PM
ratumeli ratumeli is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 20 ratumeli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
assist'ce with 'ORDER BY' clause

how can I list the various PERFORMERS which have the same CONCERTDATE AND CONCERTVENUE. So pretty much PERFORMERS performing at the same location on the same day.

SQL> desc futureconcerts;
Name Null? Type
----------------------------------------- -------- -------------
CONCERTID NOT NULL NUMBER
CONCERTVENUE VARCHAR2(20)
CONCERTDATE DATE
PERFORMERS VARCHAR2(3)

Reply With Quote
  #2  
Old November 21st, 2003, 05:09 PM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 926 shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 3 h 5 m
Reputation Power: 54
select concertdate, concertvenue, performers
from futureconcerts
order by 1,2;

This is so damn easy that I'm sure I missed something in your question...

Reply With Quote
  #3  
Old November 21st, 2003, 05:43 PM
ratumeli ratumeli is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 20 ratumeli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
That what I did too but is not correct. Lemme see if i can explain it better.

I need to pull out performers who are going to perform at the same venue on any particular/given date. so date and venue's in common of performers...and to only list exactly that.

Table data:

CONCERTVENUE CONCERTDATE PERFID
-------------------- --------------- -------
va2 23/NOV/03 p25
va21 22/NOV/03 p25
va21 22/NOV/03 p27
va21 22/NOV/03 p26
va22 22/NOV/03 p10
va24 24/NOV/03 p25
va29 25/NOV/03 p25
va30 28/NOV/03 p35
va30 28/NOV/03 p35
va30 28/NOV/03 p45
va30 28/NOV/03 p46

-------------------------------------------------------------------

Desired Outcome:
va21 22/NOV/03 p25
va21 22/NOV/03 p27
va21 22/NOV/03 p26
va30 28/NOV/03 p35
va30 28/NOV/03 p35
va30 28/NOV/03 p45
va30 28/NOV/03 p46

Last edited by ratumeli : November 21st, 2003 at 05:49 PM.

Reply With Quote
  #4  
Old November 21st, 2003, 06:40 PM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
My guess is:

SELECT CONCERTVENUE, CONCERTDATE, PERFORMERS
FROM FUTURECONCERTS, (select CONCERTVENUE,count(*)
from FUTURECONCERTS
group by CONCERTVENUE
having count(*)>1) a
WHERE CONCERTVENUE = a.CONCERTVENUE
/

Reply With Quote
  #5  
Old November 22nd, 2003, 01:43 AM
ratumeli ratumeli is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 20 ratumeli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the effort Shafique but no go =(

Reply With Quote
  #6  
Old November 22nd, 2003, 04:40 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 926 shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 3 h 5 m
Reputation Power: 54
I knew I missed something in the original post.

Nice solution shafique!

@ratumeli: works for me, although I had to supply a table alias for the futureconcerts table in the FROM clause and qualify the columns in the select list (but I tested it with Postgres, not Oracle, but that shouldn't matter)
Code:
SELECT f1.concertvenue,
       f1.concertdate,
       f1.performers
FROM futureconcerts f1,
     (SELECT concertvenue,
             COUNT(*) 
      FROM futureconcerts
      GROUP BY concertvenue
      HAVING COUNT (*) > 1
      ) a
WHERE f1.concertvenue = a.concertvenue
order by 2

Reply With Quote
  #7  
Old November 22nd, 2003, 06:24 AM
ratumeli ratumeli is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 20 ratumeli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
All I'd like to say Shammat is BULLSEYE !

Gave me exactly what I required.

Thanks for your time and effort Shammat and you too Shafique, i tried to mod your code to my liking but I must have wondered off somewhere.

Reply With Quote
  #8  
Old November 22nd, 2003, 07:59 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 926 shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level)shammat User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 3 h 5 m
Reputation Power: 54
The credit goes to shafique. It's basically the same statement!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > assist'ce with 'ORDER BY' clause


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway