Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select into a table
Message
 
 
À
09/12/2003 13:54:39
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00857318
Message ID:
00857331
Vues:
23
This message has been marked as the solution to the initial question of the thread.
I'm not sure what "a resident table" is. If it's existing table, than you can use INSERT INTO command. If you want to create new table, than SELECT INTO
INSER INTO mytable 
  SELECT ...
...
SELECT ...
INTO mytable 
FROM ...
>Hi,
>
>I have a select statement that returns a number of columns and rows. I would like to insert these rows into a resident table.
>
>Here is an example of what I am trying to do:
>
>SELECT Number,CreatedDate,OrderedDate,OrderCompletedDate
>,(CASE WHEN (Number LIKE 'S-%' OR Number LIKE '%-C%')
>THEN DATEDIFF(dd,CreatedDate,OrderCompletedDate)
>ELSE
>DATEDIFF(dd,OrderedDate,OrderCompletedDate)
>END) as TurnAroundTime,
>Status
>FROM AroundTime
>WHERE OrderedDate BETWEEN '08/01/2003' AND '10/10/2003'
>AND Number LIKE 'TO%'
>ORDER BY Number
>
>
>
>How can I get the returned data into the resident table?
>
>Thanks,
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform