Microsoft
Software
Hardware
Network
Question : Count query help
I need to creat a query that returns items in my table that appear > 3 times and I'm getting a little stuck on the syntax.
I have a table containing:
ID Instance Code
I want to return a list of all Codes where that code appears more than 3 times. I am getting stuck on how to select these distinct codes, any help much appreciated.
Answer : Count query help
Correction :
1:
SELECT Code, COUNT(*) FROM yourTable GROUP BY Code HAVING COUNT(*)>3
Open in New Window
Select All
Random Solutions
Tried to reboot xp machine remotely but it got stuck, any way to force a reboot via command line?
STOP: 0x0000007E (0xC0000420, xxxxxx) acpi.sys - address 83AB9717
Need SQL Syntax help to make my qry more efficient.
SQL Syntax
sql server 2005 datetime min
"Data type mismatch in criteria expression." when comparing dates
.NET CF Performance counters are missing
Printer goes offline during print job
There is insufficient system memory in resource pool 'internal' to run this query. WE upgraded from a 32 bit, 4 GB, Windows 2003 server, SQL server 2005 machine to a 64 bit, 2 processor quad core, 8
Have full control in Sharepoint but cannot view groiup