dbTalk Databases Forums  

Please suggest query for following situation

comp.databases.sybase comp.databases.sybase


Discuss Please suggest query for following situation in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dewang Bhansali
 
Posts: n/a

Default Please suggest query for following situation - 05-19-2004 , 07:09 AM






I have the following situation

There are 2 tables

table 1 contains

airliens
airlines zone
airlines airports

Where airlines has its own zones,and each zone has multiple airports.

table 2 contains

airlines
agent
airport code
service type
weight slabs
market / contract
buying rate

for each airline,agent,airport,service type,weightslab,market /
contract there is onebuying rate

so now if we consider data intable 2 as
1,1,1,1,10,M,100
1,1,2,1,10,M,100
1,1,3,1,10,M,150
1,1,10,1,10,M,200
1,1,20,1,10,M,300

and data in table 1 is

1,100,1 }
1,100, 2 } --- Airlines Zone 100
1,100,3 }

1,200,4 }--|
1,200,5 }--| Airlines Zone 200

now i want to write a single query so that my result set is

1,1,100,10,M,100/150
1,1,200,10,M,200/300

ie for each airlines instead of getting data for individual airports i
want to have data single record for airlines zone (100/150,200/300
indicates that rate that it retrieves could be any oneof them)

Please treat is as urgent.

Regards,

Dewang Bhansali

Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.