• second option for the same requiment

    declare @temp table(t varchar(50))

    insert into @temp

    select * from

    (

    values

    ('a.p'),

    ('y.a.p'),

    ('k.p')

    )a (name)

    select *

    from @temp

    where CHARINDEX('.',t,CHARINDEX('.',t)+1)=0