Home » SQL & PL/SQL » SQL & PL/SQL » DECODE QUERY
DECODE QUERY [message #353092] Sat, 11 October 2008 05:46 Go to next message
vchimakurthi@gmail.com
Messages: 3
Registered: October 2008
Junior Member
hi
pls guide me write a query

i got tables

1.LOCATIONS TABLE
"LOCATION_ID,"DESCRIPTION"
2.INFORMATION TABLE
INFORMATION_ID
DESCRIPTION
AGENT_ID
TARGET_ID
ACCESS_COST

3.COST TABLE
COST_ID
LOWER_BOUND_LEVEL
UPPER_BOUND_LEVEL
COST




i need to generate a query

for each location with three or more targets ,the total number of targets, and the total cost of information generated by targets in that location divided into The following ranges:
< 1 1 - 2.99 3 - 4.99 5 - 6.99 >= 7

Re: DECODE QUERY [message #353118 is a reply to message #353092] Sat, 11 October 2008 11:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64116
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous post:
Michel Cadot wrote on Sat, 11 October 2008 07:58
Post a test case: create table and insert statements along with the result you want with these data.

Also please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.

Regards
Michel

Re: DECODE QUERY [message #353211 is a reply to message #353092] Sun, 12 October 2008 22:33 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

I doubt anybody understand your requirement clearly .
Repeat the post with Examples and scripts as suggested by Michel.

Thumbs Up
Rajuvan.
Re: DECODE QUERY [message #353234 is a reply to message #353092] Mon, 13 October 2008 01:16 Go to previous message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
hi,

where is location_id in information table or on the cost
what are the keys interlinked through fk reference.
your requirement can not be met with specified tables
yours
dr.s.raghunathan
Previous Topic: MIN MAX SUBQUERIES
Next Topic: Switch Time
Goto Forum:
  


Current Time: Tue Dec 06 02:15:31 CST 2016

Total time taken to generate the page: 0.12745 seconds