-5

SQL select attract but query I want to give the results as follows.

Select * from table where ???? Result

enter image description here

BuuRoCk
  • 79
  • 1
  • 1
  • 10

1 Answers1

0

If I understood what you want .... this is how i would do it

if object_id('tempdb..#Temp') is not null drop table #Temp
create table #Temp (FirmName nvarchar(50))

insert into #Temp (FirmName) 
values ('Emlak 17'),
   ('Sanane Emlak'),
   ('GE Emlak => Result'),
   ('45 Emlak'),
   ('Emlak 3Z'),
   ('Burak Emlak')

select * from #Temp
    where Len(LEFT(FirmName, charindex(' ',FirmName, 0))) = 2
       or LEN(RIGHT(FirmName,LEN(FirmName)-CHARINDEX(' ',FirmName))) = 2

Just copy paste it and give it a go ... let me know if that worked for you and please man, read the part "How to ask a question"

Veljko89
  • 1,813
  • 3
  • 28
  • 43