RE: help on moving data from on table to another

RE: help on moving data from on table to another

 

  

insert mytable(cnt1,cnt2,cnt3,mydate)
select top 1
(select count(*) from srctbl where col='something1')
,(select count(*) from srctbl where col='something2')
,(select count(*) from srctbl where col='something3')
,getdate()
from srctbl


-----Original Message-----
From: Perry Gentry [mailto:[Email Address Removed] Tuesday, October 21, 2003 2:24 PM
To: LazyDBA.com Discussion
Subject: help on moving data from on table to another


All, I have a new table with four columns.
1st column is count95
2nd column is count NT
3rd coulmn is countXP
4th column is date

I want to populate the new table with a select count(*) from an existing
table where OSType = 'windows 95' and so on. I want to populate all fields
at the same time and then put current date (10/21/2003) in the date field.
Could someone help me with the syntax. I know what I want to do, but I'm
having a hell of a time figuring out how to lay in out.
I hope this makes sense.

Thanks

_________________________________________________________________
Add MSN 8 Internet Software to your current Internet access and enjoy
patented spam control and more. Get two months FREE!
http://join.msn.com/?page=dept/byoa


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Get today's cartoon: http://www.LazyDBA.com
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page