如果長度一樣就好辦
select distinct substring(ip,0,8) as ip1 from 表
这个不能实现吧??
多谢,这样就行了SELECT DISTINCT SUBSTRING(IP, LEN(IP- CHARINDEX('.', REVERSE(IP + 1) AS GateWay FROM Table
[此贴子已经被作者于2006-8-29 9:25:40编辑过]