在我的计划中,我有这个声明......
ct = String.Format(@"select [Movie Selector] from WSTMDS3
natural prediction join
(select
'{0}'as[Age],
'{1}'as[Education Level],
'{2}'as[Gender],
'{3}'as[Home Ownership],
'{4}'as[Internet Connection],
'{5}'as[Marital Status]
)as MovieSelector",
TextBox1.Text,
DropDownList1.SelectedValue,
DropDownList2.SelectedValue,
DropDownList3.SelectedValue,
DropDownList4.SelectedValue,
DropDownList5.SelectedValue)
;
Run Code Online (Sandbox Code Playgroud)
但是在DropDown list1"教育水平"中,我有一些像这个硕士学位的价值,我在这个陈述中如何使用单引号.
谢谢
我有这样的声明:
SELECT COUNT(AccedentId) AS NumberOfAccedentInYear
FROM Accident
GROUP BY DriverId, YEAR(AccedentDate)
HAVING (DriverId =@DriverId)<3
Run Code Online (Sandbox Code Playgroud)
当有行时,我得到一个有效的计数,但当没有行时,结果为空。当没有匹配的行时,我希望结果为 0。