Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从列中获取一些数据。
例如,我在 peter@msn.com 之类的列中有数据。我想获得 msn.com。
我怎样才能得到那个?
试试这个:
DECLARE @a VARCHAR(100) = 'peter@msn.com' SELECT RIGHT(@a, LEN(@a) - CHARINDEX('@', @a))
SELECT SUBSTRING(Columnname,7,LEN(Columnname));