[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

i need to count the reverse string sector

Asked by rehman123 in Programming Languages

I need your help to solve this query on very urgent basis may be you can help me .

 

I have one table .

 

 

CREATE OR REPLACE FORCE VIEW HRMSMAIN.VF_TRAVELREQUEST_SECTOR

(TRS_ID, TRS_SLNO, TRS_TRH_ID, TRS_TRT_SNO, TRS_SECTOR_SOURCE_ID,

 TRS_SECTOR_DESTINATION_ID, TRS_DATE, TRS_CLASS_ID, TRS_FLIGHTNO, TRS_STATUS_FLAG,

 TRS_TICKET_COLLECTED, TRS_TICKET_COLLECTED_DATE, TRS_REMARKS, TRS_REASSIGNED_DATE, TRS_SUB_CLASS_ID,

 SOURCENAME, SOURCEABBRIVATION, DESTINATIONNAME, DESTINATIONABBRIVATION)

AS

Select Travel_Request_Sector."TRS_ID",Travel_Request_Sector."TRS_SLNO",Travel_Request_Sector."TRS_TRH_ID",Travel_Request_Sector."TRS_TRT_SNO",Travel_Request_Sector."TRS_SECTOR_SOURCE_ID",Travel_Request_Sector."TRS_SECTOR_DESTINATION_ID",Travel_Request_Sector."TRS_DATE",Travel_Request_Sector."TRS_CLASS_ID",Travel_Request_Sector."TRS_FLIGHTNO",Travel_Request_Sector."TRS_STATUS_FLAG",Travel_Request_Sector."TRS_TICKET_COLLECTED",Travel_Request_Sector."TRS_TICKET_COLLECTED_DATE",Travel_Request_Sector."TRS_REMARKS",Travel_Request_Sector."TRS_REASSIGNED_DATE",Travel_Request_Sector."TRS_SUB_CLASS_ID",a.MSI_Destination as SourceName, a.MSI_Abbrivation as SourceAbbrivation,b.MSI_Destination as DestinationName,b.MSI_Abbrivation as DestinationAbbrivation

From Travel_Request_Sector,M_Sector_Index a, M_Sector_Index b

Where TRS_Sector_Source_Id = a.MSI_id and TRS_Sector_Destination_Id = b.MSI_Id;

 

 

 

And second one is

 

 

 

 

CREATE OR REPLACE FORCE VIEW HRMSMAIN.VF_TRAVELLERS

(TRT_TRH_ID, TRT_SNO, TRT_DEPEND_ID, TRT_TRAVELLERS, TRT_DOB,

 TRT_TT_ID, TRT_CARRIER_ID, TRT_TICKETNO, TRT_USER_TICKVALIDITY, TRT_ADMIN_TICKVALIDITY,

 TRT_REFUND_FLAG, TRS_ACTUALRATE, TRS_GROSS_RATE, TRS_TAX, TRS_DIFFRATE,

 TRT_SECTOR_FLAG, TRS_MRMS, TRS_ISCOMPANY, TRS_CRADITAMOUNT, TRS_CRADIT_DATE,

 TRS_CREDIT_AGREED, TRS_CREDIT_AGREED_REMARKS, TRS_CREDIT_AGREED_DATE, TRS_INCENTIVE, TRS_MIXEDCARRIER,

 TRS_APPR_REFUND, TRS_INCENTIVE_FLAG, TRT_AL_ENT, TRT_RR_ENT, TRT_JACKET_COLECTED,

 TRT_JC_DATE, TRS_SURCHARGE, DEPEND_NAME, DEPEND_DATE_OF_BIRTH, RELATION_DESCRIPTION,

 TT_DESC, TT_SORT_ID, TRAEMPNAME, CARRIER_NAME, CARRIER_ABBRIVATION)

AS

Select TR_Travellers."TRT_TRH_ID",TR_Travellers."TRT_SNO",TR_Travellers."TRT_DEPEND_ID",TR_Travellers."TRT_TRAVELLERS",TR_Travellers."TRT_DOB",TR_Travellers."TRT_TT_ID",TR_Travellers."TRT_CARRIER_ID",TR_Travellers."TRT_TICKETNO",TR_Travellers."TRT_USER_TICKVALIDITY",TR_Travellers."TRT_ADMIN_TICKVALIDITY",TR_Travellers."TRT_REFUND_FLAG",TR_Travellers."TRS_ACTUALRATE",TR_Travellers."TRS_GROSS_RATE",TR_Travellers."TRS_TAX",TR_Travellers."TRS_DIFFRATE",TR_Travellers."TRT_SECTOR_FLAG",TR_Travellers."TRS_MRMS",TR_Travellers."TRS_ISCOMPANY",TR_Travellers."TRS_CRADITAMOUNT",TR_Travellers."TRS_CRADIT_DATE",TR_Travellers."TRS_CREDIT_AGREED",TR_Travellers."TRS_CREDIT_AGREED_REMARKS",TR_Travellers."TRS_CREDIT_AGREED_DATE",TR_Travellers."TRS_INCENTIVE",TR_Travellers."TRS_MIXEDCARRIER",TR_Travellers."TRS_APPR_REFUND",TR_Travellers."TRS_INCENTIVE_FLAG",TR_Travellers."TRT_AL_ENT",TR_Travellers."TRT_RR_ENT",TR_Travellers."TRT_JACKET_COLECTED",TR_Travellers."TRT_JC_DATE",TR_Travellers."TRS_SURCHARGE", DEPEND_NAME,DEPEND_DATE_OF_BIRTH, RELATION_DESCRIPTION,TT_Desc,TT_Sort_Id,Ret_Travellers_IfEmployee(TRT_TRH_id,TRT_TT_ID) as TraEmpName, Carrier_Name,Carrier_Abbrivation

From TR_Travellers, M_Dependant, M_RELATION,Travellers_Type, M_Carrier

Where TRT_Depend_Id=Depend_Id(+) and DEPEND_RELATION= RELATION_ID(+) and TRT_TT_ID = TT_Id(+) and TRT_Carrier_Id = Carrier_Id(+);

 

 

 

 

 

After that I am wring this query .

 

SELECT A.CARRIER_ABBRIVATION, TRT_TRH_ID, TRT_SNO,b.SourceName ,b.destinationname,b.SourceName ||'-'||b.DESTINATIONNAME as DESTINATION,

b.DESTINATIONNAME||'-'||b.SourceName as DESTINATION1,C.LPOH_DATE ,count(*)

FROM vf_travellers A,vf_travelrequest_sector B, LPO_Header C

WHERE(A.TRT_TRH_ID = B.TRS_TRH_ID And A.TRT_TRH_ID = C.LPOH_TRH_ID And A.TRT_SNO = B.TRS_TRT_SNO )

and b.TRS_SECTOR_DESTINATION_ID IN(SELECT MSI_ID FROM m_sector_index C )

and  C.LPOH_DATE BETWEEN '01-jan-2006' AND '01-Mar-2006' and A.TRT_TRH_ID in ( 15613)

GROUP BY A.CARRIER_ABBRIVATION, TRT_TRH_ID, TRT_SNO,b.SourceName ,b.DESTINATIONNAME,C.LPOH_DATE

,TRS_SECTOR_SOURCE_ID, TRS_SECTOR_DESTINATION_ID

ORDER BY A.CARRIER_ABBRIVATION, TRT_TRH_ID, TRT_SNO

 

 

 

 

 

Out put is

 

 

CARRIER_ABBRIVATION
 TRT_TRH_ID
 TRT_SNO
 SOURCENAME
 DESTINATIONNAME
 DESTINATION
 DESTINATION1
 LPOH_DATE
 COUNT(*)
 
A9
 15,613.00
 1.00
 Dubai
 Tbilisi
 Dubai-Tbilisi
 Tbilisi-Dubai
 01/03/2006 12:01:23
 1.00
 
A9
 15,613.00
 1.00
 Tbilisi
 Dubai
 Tbilisi-Dubai
 Dubai-Tbilisi
 01/03/2006 12:01:23
 1.00
 
A9
 15,613.00
 2.00
 Dubai
 Tbilisi
 Dubai-Tbilisi
 Tbilisi-Dubai
 01/03/2006 12:01:23
 1.00
 
A9
 15,613.00
 2.00
 Tbilisi
 Dubai
 Tbilisi-Dubai
 Dubai-Tbilisi
 01/03/2006 12:01:23
 1.00
 
AI
 15,577.00
 1.00
 Pune
 Dubai
 Pune-Dubai
 Dubai-Pune
 01/02/2006 17:58:04
 1.00
 
AI
 15,577.00
 2.00
 Pune
 Dubai
 Pune-Dubai
 Dubai-Pune
 01/02/2006 17:58:04
 1.00
 
AI
 15,577.00
 3.00
 Pune
 Dubai
 Pune-Dubai
 Dubai-Pune
 01/02/2006 17:58:04
 1.00
 
EK
 15,629.00
 1.00
 Beirut
 Dubai
 Beirut-Dubai
 Dubai-Beirut
 01/06/2006 13:01:06
 1.00
 
EK
 15,629.00
 1.00
 Dubai
 Beirut
 Dubai-Beirut
 Beirut-Dubai
 01/06/2006 13:01:06
 1.00
 
EK
 15,629.00
 2.00
 Beirut
 Dubai
 Beirut-Dubai
 Dubai-Beirut
 01/06/2006 13:01:06
 1.00
 
EK
 15,629.00
 2.00
 Dubai
 Beirut
 Dubai-Beirut
 Beirut-Dubai
 01/06/2006 13:01:06
 1.00
 
EK
 15,629.00
 3.00
 Beirut
 Dubai
 Beirut-Dubai
 Dubai-Beirut
 01/06/2006 13:01:06
 1.00
 
EK
 15,629.00
 3.00
 Dubai
 Beirut
 Dubai-Beirut
 Beirut-Dubai
 01/06/2006 13:01:06
 1.00
 
EK
 15,629.00
 4.00
 Beirut
 Dubai
 Beirut-Dubai
 Dubai-Beirut
 01/06/2006 13:01:06
 1.00
 
EK
 15,629.00
 4.00
 Dubai
 Beirut
 Dubai-Beirut
 Beirut-Dubai
 01/06/2006 13:01:06
 1.00
 
 
 
 
 
 
 
 
 
 
 

 

 

Here  now I need that  destination or destination1 in either way like

 

Dubai-Tbilisi

Tbilisi-Dubai

It should read as count 2



 

 

Either he fly from Dubai – Tbilisi

Or  Tbilisi to Dubai

 

He should read count as 2



[+][-]10/21/06 08:15 AM, ID: 17780536Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Programming Languages
Sign Up Now!
Solution Provided By: mish33
Participating Experts: 1
Solution Grade: A
 
[+][-]11/22/06 12:54 PM, ID: 17998938Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]11/26/06 05:51 PM, ID: 18016385Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92