Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Please tell me
Message
 
 
À
19/01/2002 01:43:18
Information générale
Forum:
Oracle
Catégorie:
Autre
Titre:
Divers
Thread ID:
00606595
Message ID:
00607249
Vues:
21
YOu can not d what you want in a single select. You can do this in a stored procedure, or you can create 2 remote views based on:
create sql view rv_CountOf1DayAfter remote connection connect_name share as ;
   SELECT Count(CustomerID) as CountOf1DayAfter ;
   FROM sampleut1 ;
   WHERE (DepartureDate - ArrivalDate) = 1

create sql view rv_CountOf2DayAfter remote connection connect_name share as ;
   SELECT Count(CustomerID) as CountOf2DayAfter ;
   FROM sampleut1 ;
   WHERE (DepartureDate - ArrivalDate) = 2
Now just open the two views, and insert their values into the table.

>Mark,
> Actually i have two queries, i want to combine those two as one.That two queries are as follows.
>1.INSERT INTO sampleut2 SELECT Count(CustomerID) as CountOf1DayAfter FROM sampleut1 WHERE (DepartureDate - ArrivalDate) = 1
>2.SELECT Count(CustomerID) as CountOf2DaysAfter FROM sampleut1 WHERE (DepartureDate - ArrivalDate) = 2
>
> And i combined the above two queries as
>
>INSERT INTO sampleut2(CountOf1DayAfter,CountOf2DaysAfter)
> (SELECT Count(CustomerID) as CountOf1DayAfter FROM sampleut1 WHERE (DepartureDate - ArrivalDate) = 1,SELECT Count(CustomerID) as CountOf2DaysAfter FROM sampleut1 WHERE (DepartureDate - ArrivalDate)=2)
>
> Its giving syntax error.is it correct way.please tell me how to combine those two.
> Thanks.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform