Sql server error using case -
i have here query wrote in visual studio using sql server 2010. extension mdf think i'm using sql server. here structure of table.
occupantid int contacttypeid int contactdetail varchar(255) maincontacttype bit
here sql.
select contactdetail.*, contacttype, firstname + ' ' + lastname occupantname, case when maincontacttype = 1 'yes' else 'no' maincontacttype contactdetail inner join occupant on contactdetail.occupantid=occupant.occupantid inner join contacttype on contactdetail.contacttypeid=contacttype.contacttypeid
i'm getting error incorrect syntax near keyword as
the case
-expression must end end
:
case when maincontacttype = 1 'yes' else 'no' end maincontacttype
Comments
Post a Comment