case表达式不能返回值列表,例如,您必须执行其他操作
SQL CASE statement with multiple conditions In case you need the result to satisfy multiple conditions, you can add those conditions to the T-SQL CASE statement and combine them with the AND operator: CASE expression WHEN condition1 AND condition2 THEN result1 ELSE result2 END ...
OR ) CASE WHEN sex = ‘1’ THEN ‘男’ WHEN sex = ‘2’ THEN ‘女’ ELSE ‘其他’ END...
You can try those conditions :
At a high-level, the syntax for a SQL CASE statement is shown below. Here, we specified multiple conditions. SQL Server evaluates the conditions sequentially. Once a condition evaluates successfully, it stops the evaluation of remaining conditions. If none of the conditions are satisfied, we can...
when basin=prebasin use the numberinbasinnew from the first row (basin<>prebasin) and calculate the second row value for numberinbasinnew based on below conditions -- CASE … SQL Server SQL Server A family of Microsoft relational database management and analysis systems for e-commerce, ...
This becomes more useful when considering the implicit casting features within SQL Server. The same query can be used for integer, date/time, GUID, or floating-point data types. Other methods of processing a list of values would require multiple functions or stored procedures ...
A required Privilege is not held by client in ssis With Proxy account A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The pipe has been ended.) A truncation occurred during evaluation of the expression Acces to the pa...
Alter Multiple Procedures with One sql script Alter Stored Procedure is taking huge time in sql server Alter Table Add Column if Not Exists to update Schema Modification Script Alter Table add Column - How do you add a column after say the second column Alter table add constraint primary key ...
SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) SQL analytics endpoint in Microsoft Fabric Warehouse in Microsoft Fabric SQL database in Microsoft Fabric Evaluates a list of conditions and returns one of multiple possible result expressions...