devxlogo

Tip Bank

Get the Average Value Across the Columns by Using the AVG() Function

CREATE TABLE tblSales (MonthNumber int,MonthName varchar(10) PRIMARY KEY,ProductA INT,ProductB INT,ProductC INT) INSERT INTO tblSales Select 1,’Jan’,5800,5900,5400 union allSelect 2,’Feb’,5750,5950,5500 union allSelect 3,’Mar’,6200,5700,7100 union allSelect 4,’Apr’,6300,5900,5400 union allSelect 5,’May’,5350,5650,5500 SELECT A.*,X.AvgSales

Compare Oracle and SQL Server Dates

Oracle and SQL Server databases use different date/time resolutions, which poses a problem when you compare times from the two databases: The times will rarely be equal. Solve this problem

Get Windows Name Using WMI

Here’s an easy way to get OS information using the Windows Management Instrument (WMI): Private Sub getWindowsInfo() On Error Resume Next Dim strComputername As String Dim objWMIService As Object Dim

Sorting Null Fields Last

If you sort a table from a field which has null values, Null values are typically displayed first. Here is a way to display the NULL values at last. Use