does the, CASE WHEN THEN statement have to be used with the select statement in SQL server?
declare @i int
set @i=100
case @i
when 100 then print 100
when 200 then print 200
else print 300
end
the above statement reported an error
does the, CASE WHEN THEN statement have to be used with the select statement in SQL server?
declare @i int
set @i=100
case @i
when 100 then print 100
when 200 then print 200
else print 300
end
the above statement reported an error
I am using SSMS2017, this version (perhaps earlier version has) has a function, that is, after the cursor is punctuated to something (variable, field, table name, etc.), the same string nearby will be highlighted, such as figure: " " >> similar func...
the data sent from the front desk is of date type, and then query how to report such an error in the field of date type of sql server database based on this data: ,date : : : ...
SELECT Table_1. , Table_2. , Table_3.* FROM ((Table_1 INNER JOIN Table_2 ON Table_1.DataTime = Table_2.DataTime) INNER JOIN Table_3 ON Table_2.DataTime = Table_3.DataTime) where Table_1.DataTime = 1 is not necessarily merging three tables with the same ...
I successfully run the following sql statement to find the ideal data exec sp_executesql N Select * FROM FC_Repair WHERE F_RepairDepartmentId in ( ace7f0e7-f158-4587-920d-e76546885198 , bf421a22-786b-40fd-8af...
could you tell me how to query the sql statement and how to implement it on ef? thank you ...
The sql statement is as follows SELECT sum(case when CONVERT(varchar(100), b.BillDate, 112) >= 20180101 AND CONVERT(varchar(100), b.BillDate, 112) < 20180126 then b.totalmoney else 0 end)AS , sum(case when CONVERT(varchar(100), b.BillDate, 11...
first of all, I want to query the department to which the user belongs select * from dept where id in (select deptId from employee where id= 00 ) the above statement is not good. If you want to achieve such a result, how can you use SQL statement to...
recently, I am working on a book information management system. There is a table marc that stores the information of books. There are more than 20 fields in it. when importing data, it is required to check the duplicates according to 7 fields, and the...