9626
Developer's Corner / Re: ASP.NET and C# webform. Need help with query to DB
« Last post by wraith808 on July 30, 2009, 09:16 AM »I'm not sure what database you're using, but with ASP.NET and C#, I'll assume SQL Server. Also assuming that the table name is Slot, and with everything else you've given, this query would give the number of times each SlotID has been used.
If you only wanted to get the ones that had been used more than 1 time then you could add a having clause, i.e.
HTH
Code: Text [Select]
- SELECT count(1), SlotID
- FROM Slot
- GROUP BY SlotID
If you only wanted to get the ones that had been used more than 1 time then you could add a having clause, i.e.
Code: Text [Select]
- SELECT count(1), SlotID
- FROM Slot
- GROUP BY SlotID
- HAVING count(1) > 1
HTH

Recent Posts




