Use of 1=2 in a SQL query -


someone please explain meaning of '1=2' in below sql query.

select e.empid,        e.empname,        country = case                    when t.active = 'n'                         , 1 = 2 'not working anymore'                    else c.country_name                  end,        t.contract_no   employees e (nolock)        inner join contract t          on t.contract_no = e.contract_no        left join country c (nolock)          on e.country_id = c.country_id  

thanks

edit:- corrected slight mistake existed in example sql query given me. @ :- query mentioned here example version of big working query on have reoslve something. have created sample scenario of sql query sake of simplicity of question.

when t.active = 'n' , 1=2 'not working anymore'  

simple, above condition never become true. result c.country_name


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -