Viewing 15 posts - 1 through 15 (of 17 total)
Select b.Topic, c.CompanyName, cast(a.Rating as int) as 'Cumulative Rating'
from InfoTable a
Left Join Topic b On a.TopicID=b.TopicID
Left Join Company c on a.CompanyID=c.CompanyID
--where b.ProjectID=1
Group by b.Topic,c.CompanyName
April 24, 2006 at 3:05 am
Hi
Can you please give somple data and result that you want from that..?
April 22, 2006 at 4:36 am
set nocount on
Declare @TableName varchar(128), @ColumnList varchar(1000)
Declare @sql varchar(1000)
set @TableName = 'your Table'
SELECT @ColumnList = COALESCE(@ColumnList + ', ', '') + column_name
FROM INFORMATION_SCHEMA.Columns
WHERE Ordinal_position <= 95
and table_name...
April 20, 2006 at 4:31 am
Thanks lot. Its working fine.. David Burrows
April 20, 2006 at 4:21 am
select * from #Parent p join #Child c on p.IdentityField = c.ForeignKey and recencydate =
(select max(recencydate) from #Child d where d.ForeignKey= p.IdentityField)
I hope this will do...
November 30, 2005 at 5:57 am
exec sp_Executesql 'N(@SQL) -- (N stand for Nvarchar)
November 19, 2005 at 2:46 am
As per your example this will do
SELECT Inv_Date, Inv_No, Description, SUM(Amount)
FROM #Trans
GROUP BY Inv_Date, Inv_No, Description
Inv_Date Inv_No Description Sum
2005-11-19 13:10:00 1 The 1 11
2005-11-19 13:10:00 2 The 2 ...
November 19, 2005 at 12:43 am
If we see the cursor that you have wrote then explicitly there are some errors,but first i would like to know what you would like to do.. i mean can...
November 16, 2005 at 7:29 am
Hi all
i got it.. this is the query...
select * from sales M where keyid IN
(select top 2 keyid from sales M1
where m.saleperson =m1.saleperson )
thanks all
November 16, 2005 at 6:46 am
Hi Kenneth
In the sales table we have nearly 5,00,000 lac records. It's impossible to check all the records. So that he just pick any two records for quality checking.
Franks...
November 16, 2005 at 6:37 am
And i also tried using this
select top 2* from sales M where keyid IN
(select top 2 keyid from sales M1
where M1.keyid=M.keyid and m.saleperson =m1.saleperson )
But the above...
November 16, 2005 at 6:13 am
Thanks for your response
Just for Analysis purpose, Some time sales manager wants to check some data (for quality). So SM just wants any two (or top 2) records.
November 16, 2005 at 6:10 am
update a set a.MyNewColumn = b.MyOldColumn from table1 a , table2 b where a.<keyfield> = b.<keyfield>
November 15, 2005 at 11:57 pm
Please try this
select top 0* into <new table> from customer
November 15, 2005 at 11:45 pm
Viewing 15 posts - 1 through 15 (of 17 total)