这个查询:
left join (select tSpent, Customerid
from (select SUM(spent) as tSpent, Customerid,
RN = ROW_NUMBER() OVER (PARTITION BY Customerid ORDER BY Customerid DESC)
from Customer_Sales
WHERE Customerid is not null)
where RN = 1) Sales ON Customer_Sales.Customerid = Data.Customerid
Run Code Online (Sandbox Code Playgroud)
在线给我一个错误RN=1:
关键字'where'附近的语法不正确
cf_sql_longvarchar我可以增加一个字符限制,或者可能是另一种选择吗?它似乎被切断为43,479个字符或大约40-45 kb.
好吧,所以我做了这个jquery,结果很好,但是css没有得到应用.有没有办法将css应用于结果?
function doSearch() {
//Send the AJAX call to the server
$.ajax({
//The URL to process the request
'url' : 'cf/inventoryQuery.cfm',
//The type of request, also known as the "method" in HTML forms
//Can be 'GET' or 'POST'
'type' : 'POST',
//Any post-data/get-data parameters
//This is optional
'data' : $("#SearchInventory").serialize(),
//The response from the server
'success' : function(data) {
$('#Results').html(data);
}
});
}
Run Code Online (Sandbox Code Playgroud)
编辑 - 这是获取新内容的div
<div id="Results" >
<cfoutput query="queryCars" maxrows="4">
<div class="Result">
<img src="images/samplecar.png" />
<div class="ResultText">
#strYear# …Run Code Online (Sandbox Code Playgroud) 我正在使用导入命令来导入 MySQL 数据。我收到错误消息“不允许大于 max_allowed_packet 的数据包”,但如果我立即重新运行该命令,它就可以工作。你可以看到我尝试关闭和打开命令之间的连接,这没有什么区别。有没有办法解决这个错误?
cmd.Connection = conn;
conn.Open();
cmd.CommandText = "SET GLOBAL max_allowed_packet=1024*1024*1024;";
cmd.ExecuteNonQuery();
//conn.Close();
//conn.Open();
mb.ImportFromFile(file); //Imports a large sql file
conn.Close();
Run Code Online (Sandbox Code Playgroud) 我正在尝试调试执行缓慢的查询。它有几种with表达方式,分别是left joined. 当我删除连接时,速度会大大加快。
原始查询:
;with CTE as
(
Select *
from table1
)
SELECT *
FROM table2
LEFT JOIN CTE ON table2.CTEID
Run Code Online (Sandbox Code Playgroud)
更好的查询性能:
;with CTE as
(
Select *
from table1
)
SELECT *
FROM table2
Run Code Online (Sandbox Code Playgroud)
上面是因为没有加入所以不执行CTE,还是不管怎样都执行?
如果我正在从coldfusion页面(到另一个coldfusion页面)进行AJAX调用,那么coldfusion会正确使用会话吗?我不能用这种方式使用cookies,对吗?这两个页面将有单独的application.cfc/cfm页面.
是否有设置可以让我保持通知打开直到用户单击它?
if (("Notification" in window)) {
Notification.requestPermission(function() {
var notification =
new Notification('Hello',
{
body : 'Hello',
icon: 'https://www.domain.com/images/live_chat_icon.png',
tag: 'Test' ,
});
notification.onclick = function(event) {
event.preventDefault(); // prevent the browser from focusing the Notification's tab
window.open('https://www.domain.com', '_blank');
}
window.navigator.vibrate(500);
});
}
Run Code Online (Sandbox Code Playgroud) 我有以下内容:
stock | Customer
12345 | NULL
12345 | ABC
Run Code Online (Sandbox Code Playgroud)
我想要做的是删除第一个而不影响第二个,只要有一组这样的行:
if exists (select stock from table WHERE stock='12345' AND Customer is not null )
BEGIN
DELETE FROM table WHERE stock= '12345' AND Customer is null
END
Run Code Online (Sandbox Code Playgroud)
该查询有效,但如何更改它以便我不必指定库存?我想保留与null客户的行是它是与该股票相关联的唯一值.
如果我使用coldfusion的getTempDirectory()作为生成文件的路径,浏览器有没有办法访问它?或者,如果没有,我可以将临时路径配置为某个文件夹吗?
coldfusion ×4
sql-server ×2
c# ×1
cfqueryparam ×1
cookies ×1
css ×1
javascript ×1
jquery ×1
mysql ×1
session ×1
sql ×1
subquery ×1
temp ×1