内连接(在连接时我希望用点(。)替换斜杠(/)

时间:2014-02-10 11:27:37

标签: sql-server-2008

Whenever i am using inner join the some problem is coming.

**Inner Join Query**

SELECT DISTINCT dbo.SEWER_LINE.OBJECTID, dbo.SEWER_LINE.Pipe_ID
FROM  dbo.SEWER_LINE 

INNER JOIN dbo.Division ON dbo.SEWER_LINE.Division = dbo.Division.Div_ID INNER JOIN dbo.WWS_ZONES ON dbo.SEWER_LINE.Zone_ID = dbo.WWS_ZONES.ZoneID

**One Table is :**

**select Div_ID from Table Name Division**
Div_ID is Store Like This :       **GOAPWD/DIV/III**

And Table Name SEWER_LINE         **GOAPWD.DIV/XXI**

On My Inner Join Query i want change result 

 **GOAPWD/DIV/III**  First (/) Salash Remove with Dot(.)

1 个答案:

答案 0 :(得分:0)

SELECT SUBSTRING(FIELD,0,CHARINDEX('/',FIELD))+'。' + SUBSTRING(FIELD,CHARINDEX('/',FIELD)+1,LEN(FIELD)-CHARINDEX('/',FIELD))