Saturday, May 22, 2010

Select query in SQL server 2005

Check data of the content table..

Select * from (table name)


Select query with WHERE clause....

select * from CDR (table name)  where Dt>='9/7/2009  12:00:00 AM' and Dt<='9/7/2009  11:59:00 PM'  and q931 (Table column name) = 'VERIZON USA' (file column name) and timeSlot (Table column name)= 'Success' (file column name)


Sum of select query with where clause....



USE CDR_DATA;
GO
SELECT  SUM(connectionDuration)/60
FROM dbo.CDR
WHERE connectionDuration IS NOT NULL
and q931 = 'WITRIBE' and timeSlot = 'Success'
and Dt >= '8/14/2009 12:00:00 PM' and Dt <= '8/14/2009 11:59:00 AM'
    AND connectionDuration != 0.00 
GO
 

Press F5 to run query.

No comments:

Any query contact us +923214581704 Mehndi Drama Serial