我有以下查询:
DECLARE @application_number CHAR(8)= '37832904';
SELECT
la.LEASE_NUMBER AS lease_number,
la.[LEASE_APPLICATION] AS application_number,
tnu.[FOLLOWUP_CODE] AS note_type_code -- catch codes not in codes table
FROM [dbo].[lease_applications] la
LEFT JOIN [dbo].tickler_notes_uniq tnu ON tnu.[ACCOUNT_NUMBER] = la.[ACCOUNT_NUMBER]
WHERE la.LEASE_APPLICATION = @application_number
OR @application_number IS NULL;
SELECT
la.LEASE_NUMBER AS lease_number,
la.[LEASE_APPLICATION] AS application_number,
tnu.[FOLLOWUP_CODE] AS note_type_code -- catch codes not in codes table
FROM [dbo].[lease_applications] la
LEFT JOIN [dbo].tickler_notes_uniq tnu ON tnu.[ACCOUNT_NUMBER] = la.[ACCOUNT_NUMBER]
WHERE la.LEASE_APPLICATION = @application_number;
Run Code Online (Sandbox Code Playgroud)
这两个查询之间的唯一区别是,我添加了检查该变量是否为NULL的检查。
您可以在此处找到图形化计划
问题是。为什么计划如此不同?
更新: …
sql-server sqlperformance sql-execution-plan sql-server-2014
我需要增加所有下一行的组号value <> z
.z
将意味着根据所有下一行将b
具有相同的组号.
CREATE TABLE #tmp
(
a CHAR(1)
, b INT
);
INSERT INTO #tmp (a
, b)
VALUES ('a', 1)
, ('b', 2)
, ('z', 3)
, ('c', 4)
, ('z', 5)
, ('z', 6)
, ('d', 7);
SELECT t.a
, t.b
, SUM(v.is_z) OVER (ORDER BY t.b ROWS UNBOUNDED PRECEDING) - ROW_NUMBER() OVER (ORDER BY t.b) group_nbr
FROM #tmp AS t
CROSS APPLY (SELECT CASE WHEN a = 'z' THEN 2 …
Run Code Online (Sandbox Code Playgroud) 我正在尝试创建VS Code
扩展。当我开发时它工作得很好,但是当我创建包并将其安装到它时VS Code
失败并出现以下错误:
ERR Cannot find module 'request': Error: Cannot find module 'request'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
at Function.Module._load (internal/modules/cjs/loader.js:528:25)
at Function.t._load (c:\Users\USER\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:729:537)
at Function.t.getExtensionPathIndex.then.a._load (c:\Users\USER\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:691:639)
at Function.t.getExtensionPathIndex.then.r._load (c:\Users\USER\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:655:197)
at Module.require (internal/modules/cjs/loader.js:658:17)
at n (c:\Users\USER\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:15:874)
at openBambooPlanUrlInBrowser.GIT.getGitBranchFromFileName (C:\Users\USER\.vscode\extensions\dUSER.markdown-table-of-contents-0.0.1\out\extension.js:397:41)
at getGitBranchFromFileName.exec (C:\Users\USER\.vscode\extensions\dUSER.markdown-table-of-contents-0.0.1\out\extension.js:383:17)
at ChildProcess.exithandler (child_process.js:294:7)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
Run Code Online (Sandbox Code Playgroud)
我的代码:
async openBambooPlanUrlInBrowser(fileName: string) {
new GIT().getGitBranchFromFileName(fileName, (branch: string) => {
var config: any = vscode.workspace.getConfiguration('markdown-table-of-contents').get('bitbucketRepositories'); …
Run Code Online (Sandbox Code Playgroud) javascript node.js typescript visual-studio-code vscode-extensions
存储扩展的用户设置的最佳实践是什么?我可以考虑将它们以某种特定格式保存在文本文件中。是否有使用vscode
API的集成方法?
我想克隆一个对象然后更改它,但是当我这样做时,原始对象也会更改:
let items = result.Project.ItemGroup[1].Build;
let newItem = { ...items[0] };
newItem.$.Include = `test`;
Run Code Online (Sandbox Code Playgroud)
在对newItem
对象进行赋值后,items[0]
值也会更改。
我可以使用 SSDT 发布来创建将 ONLINE 选项设置为 ON 的索引吗?如果我将这样的定义添加到索引发布中,则只是忽略该设置。SQL Server 2017 企业版
有一个简单的代码。我一直以为ROW_NUMBER外部和CROSS APPLY子句中的那个都应该生成相同的输出(在我的示例中,我例外rn = crn)。你能解释为什么不是那样吗?
CREATE TABLE #tmp ( id INT, name VARCHAR(200) );
INSERT INTO #tmp
VALUES ( 1, 'a' ),
( 2, 'a' ),
( 3, 'a' ),
( 4, 'b' ),
( 5, 'b' ),
( 6, 'c' ),
( 7, 'a' );
SELECT name,
ROW_NUMBER() OVER ( PARTITION BY name ORDER BY id ) AS rn,
a.crn
FROM #tmp
CROSS APPLY (
SELECT ROW_NUMBER() OVER ( PARTITION BY name ORDER BY id ) AS crn
) a; …
Run Code Online (Sandbox Code Playgroud) t-sql sql-server sql-server-2008 sql-server-2008-r2 cross-apply
我正在尝试将外键添加到数据库,然后更新模型。更新模型后,应用程序出现以下错误:
System.Data.Entity.Core.MetadataException was unhandled
HResult=-2146232007
Message=Schema specified is not valid. Errors:
The relationship 'Accounting.Data.Repository.FK_np_DocumentStatuses_DocumentsTracking_StateId' was not loaded because the type 'Accounting.Data.Repository.DocumentsTracking' is not available.
The following information may be useful in resolving the previous error:
The required property 'DocumentsTrackingChildDocuments' does not exist on the type 'Accounting.Entity.DocumentsTracking'.
The relationship 'Accounting.Data.Repository.FK_np_DocumentsTracking_DocumentsTrackingChildDocuments_DocumentsTrackingId' was not loaded because the type 'Accounting.Data.Repository.DocumentsTracking' is not available.
The following information may be useful in resolving the previous error:
The required property 'DocumentsTrackingChildDocuments' does not exist on the type …
Run Code Online (Sandbox Code Playgroud) 我试图将"帮助"按钮粘贴到电报机器人聊天屏幕的底部.就像是:
据我所知,我需要使用内联键盘.然而
InlineKeyboardButton[] inlineKeyboardButtons = new InlineKeyboardButton[1];
inlineKeyboardButtons[0] = new InlineKeyboardButton("Help");
InlineKeyboardMarkup mrk = new InlineKeyboardMarkup(inlineKeyboardButtons);
await Bot.SendTextMessageAsync(chatId, "<b>Help</b>", replyMarkup: mrk);
Run Code Online (Sandbox Code Playgroud)
按钮没有粘在页面底部,如果您键入文本,此按钮会上升.如何让它始终在机器人聊天的底部?
我想生成摘要文本并以某种方式显示它。我很高兴听到任何实现它的方法,但是我认为有可能打开新标签并在那里写下所有内容。如何打开新标签并在其中写入一些文本?安装/更新后,某些软件包会在单独的选项卡中显示发行说明。或者也许有其他方法可以显示相当多的文本?
sql-server ×4
.net ×2
c# ×2
javascript ×2
node.js ×2
typescript ×2
cross-apply ×1
sql ×1
t-sql ×1
telegram ×1
telegram-bot ×1