/* Reprint Please specify the source and retain this copyright information * *
in doing site statistics experts, we need to statistics and analysis of IP address segment, where the application of Sql-server custom functions and stored procedures to achieve direct results in the database, the following code slightly modified.
/* SQL statement */
Select Top Dbo.fn_ipleft3 (IPAddress), Count (IDs) from Tblstatisticaldetail Group by DBO.FN_IPLEFT3 (IPAddress) Orde R by count (ID) desc
/* Custom Function content * *
CREATE function fn_ipleft3 (@ipaddr varchar (100))
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.