我想用条件'和'从句执行一个SQL select查询,但遇到了困难。SQL:我如何使用条件where子句构造一个select查询?
我愿做这样的事情:
select * from customer
where active = true
and
case
when state = 'AK'
then zipcode like '%701'
when state = 'NV'
then zipcode like '%523'
else
then phone not null;
我该如何去如何组织我的查询做到这一点?
在此先感谢您提供的任何指导。
也许你应该尝试阅读文档。这是** [SQL SERVER](https://msdn.microsoft.com/en-us/library/ms181765.aspx)** –