我有一个表tbl_test:
create table tbl_test (
tabid int identity
)
Run Code Online (Sandbox Code Playgroud)
与价值观:
Insert into tbl_test values 1 union 2 union 3 .... union 1000
Run Code Online (Sandbox Code Playgroud)
查询:
select MAX(b.tabid) from
(
select top 100 * from tbl_test
) as b
Run Code Online (Sandbox Code Playgroud)
我希望这个查询返回100,但它返回1000.
如何在Haskell中找到值的类型?
我想要这样的东西:
data Vegetable =
Und Under
|Abv Above
is_vegetable ::a->Bool
is_vegetable a = if (a is of type Vegetable) then True else False
Run Code Online (Sandbox Code Playgroud)
更新:
我想要一个数据结构来模拟上面的树.
我还想要一些函数(is_drink,is_vegetable,is_wine,is_above),以便我可以在列表中应用一些过滤器.

如何在Visual Basic中将日期格式设置为sql 121样式(即yyyy-mm-dd hh:mi:ss.mmm).
我意识到这种格式不在FormatDateTime对象列表中.
我想将此格式用于Reporting Services.
如何使用该String.Replace功能使用模式?
我想做什么:
newTextBox = newTextBox.Replace("<Value> #'a string of any number of chars#' </Value>",
"<Value>" + textBoxName + "</Value>");
Run Code Online (Sandbox Code Playgroud)
#'任意数量的字符串#'可以是任何字符串.
我试图传递一个包含字符"从c#到sql server使用的脚本"
thisCommand.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)
问题是String在字符串内表示为"而不是":
thisCommand.CommandText = SQLscript; (string SQLScript)
Run Code Online (Sandbox Code Playgroud)
如何将所有"字符转换为"以便在sql中我只得到"?
感谢阅读脚本的建议:
StreamReader s = new StreamReader("export_script.sql");
this.SQLscript = s.ReadToEnd();
Run Code Online (Sandbox Code Playgroud)
执行脚本:
thisCommand.CommandText = SQLscript;
thisCommand.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)
在脚本里面我有类似的东西:
set @cmd = 'bcp "'+ @cmd_select + '" queryout "' + @partname + '" -c -S ' + @@SERVERNAME
Run Code Online (Sandbox Code Playgroud)
你可以看到我使用"for bcp命令"