我可以请你帮忙吗?
我试图计算我的结果中从一个记录到下一个记录的变化.如果我向您展示我当前的查询和结果,它可能会有所帮助......
SELECT A.AuditDate, COUNT(A.NickName) as [TAccounts],
SUM(IIF((A.CurrGBP > 100 OR A.CurrUSD > 100), 1, 0)) as [Funded]
FROM Audits A
GROUP BY A.AuditDate;
Run Code Online (Sandbox Code Playgroud)
查询给了我这些结果......
AuditDate D/M/Y TAccounts Funded
--------------------------------------------
30/12/2011 506 285
04/01/2012 514 287
05/01/2012 514 288
06/01/2012 516 288
09/01/2012 520 289
10/01/2012 522 289
11/01/2012 523 290
12/01/2012 524 290
13/01/2012 526 291
17/01/2012 531 292
18/01/2012 532 292
19/01/2012 533 293
20/01/2012 537 295
Run Code Online (Sandbox Code Playgroud)
理想情况下,我想得到的结果将类似于以下内容......
AuditDate D/M/Y TAccounts TChange Funded FChange
------------------------------------------------------------------------
30/12/2011 506 0 …Run Code Online (Sandbox Code Playgroud) 我可以请求在共享托管服务器上设置phantomjs一点帮助吗?
让我来看看我做了什么,然后问我的问题.
采取的步骤......
使用'Putty'来检查我的服务器的架构,就像这样......
uname –m // x86_64
cat /etc/issue // Debian GNU/Linux 6.0 \n \l
Run Code Online (Sandbox Code Playgroud)
我下载了"phantomjs-1.9.8-Linux的x86_64.tar.bz2"的64位版本从这个页面https://bitbucket.org/ariya/phantomjs/downloads
将该文件放在我服务器上的文件夹中并在Putty中运行下一个命令...
tar -jxvf phantomjs-1.9.8-linux-x86_64.tar.bz2
Run Code Online (Sandbox Code Playgroud)
提取并创建了一个目录结构的文件,看似没有错误.我改为那个目录并运行ls.phantomjs文件是列出的唯一文件.
我用Putty检查了文件......
file phantomjs
Run Code Online (Sandbox Code Playgroud)
哪个回来了
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
Run Code Online (Sandbox Code Playgroud)
进入
echo "$PWD/phantomjs"
Run Code Online (Sandbox Code Playgroud)
给我
/homepages/24/someNumber/htdocs/cabs/mySite/phantom/bin/phantomjs
Run Code Online (Sandbox Code Playgroud)
接下来我试过了
/homepages/24/someNumber/htdocs/cabs/mySite/phantom/bin/phantomjs -–version
Run Code Online (Sandbox Code Playgroud)
结果是" 没有这样的文件或目录 "错误......
-bash: /homepages/24/someNumber/htdocs/cabs/mySite/phantom/bin/: No such file or directory
Run Code Online (Sandbox Code Playgroud)
但是,如果我进入
/homepages/24/someNumber/htdocs/cabs/mySite/phantom/bin/
Run Code Online (Sandbox Code Playgroud)
然后我明白了
/homepages/24/someNumber/htdocs/cabs/mySite/phantom/bin/: Is a directory
Run Code Online (Sandbox Code Playgroud)
可能是一个linux新手请问我出错的地方.自述文件提到在5分钟内启动并运行.所以,我有一种可怕的感觉,我错过了一些基本的东西.
谢谢.
编辑
幻像目录中的权限
-rwxrwxrwx 1 u387xx ftpusers 38346752 Oct 24 …Run Code Online (Sandbox Code Playgroud) 我已经声明了类似于以下的类型.
type
TLikes = record
Name : string[20];
favColours : array of string[20];
faves = array of TLikes;
Run Code Online (Sandbox Code Playgroud)
填充记录后,我将它们保存为二进制文件,因此结构如下所示.
[John], [Green] [White] [Blue]
[Paul], [Blue] [Red] [White] [Green]
[David], [Red] [Blue] [Green]
[Bob], [White] [Blue]
[Peter], [Blue] [Green] [Red]
Run Code Online (Sandbox Code Playgroud)
例如,很容易找出大卫喜欢的颜色.当我想要知道谁喜欢蓝色时,会出现一个小问题.所以我所做的就是构建第二个文件,就像这样......
[Blue], [John] [Paul] [David] [Peter] [Bob]
[Red], [David] [Paul] [Peter]
[White], [Bob] [David] [John] [Paul]
[Green], [John] [David] [Paul] [Peter]
Run Code Online (Sandbox Code Playgroud)
但有些东西告诉我,我不应该真的需要创建第二个文件/数据结构,它看起来效率低下.
这是一个更大的问题......
如果我需要找到谁喜欢David喜欢的任何组合怎么办?我的结果将是......
Blue and red and green = Paul, David, Peter
Blue and red = Paul, David, Peter
Blue …Run Code Online (Sandbox Code Playgroud) 我正在使用Indy 10.5.7
我最近看到了如何使用Indy登录具有有效凭据的网站.现在我可以执行搜索并返回我需要的结果.
但是,我还是有问题.我必须理所当然地认为我已成功登录页面重定向,因为我无法获得200以外的响应代码.
我的意思是,我想处理用户输入用户名或密码输入错误的情况,并至少告诉他们有什么不对劲.
为了这个问题,我把Indy设置如下......
var
client : TidHTTP;
cookieMan : TidCookieManager;
params : TStringList;
response : string;
begin
cookieMan := TidCookieManager.Create(nil);
client := TidHTTP.Create(nil);
params := TStringList.Create;
try
with client do
begin
ProtocolVersion := pv1_1;
HTTPOptions := [hoForceEncodeParams, hoKeepOrigProtocol];
AllowCookies := True;
cookieManager := cookieMan;
HandleRedirects := True;
//Request.UserAgent := 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0';
//Request.UserAgent := 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.103 Safari/537.36';
Request.UserAgent := 'Mozilla/5.0 (X11; U; Linux i586; …Run Code Online (Sandbox Code Playgroud) 想象一下,您在类似于以下的表中有一些数据......
line1 line2 line3 city zipcode
1 Any Road NULL NULL Big Apple 12345
The White House Pennsylvania Avenue NULL Washington 20500
10 Downing Street NULL NULL London SW1A 2AA
Run Code Online (Sandbox Code Playgroud)
如何返回非空字段的值。以“白宫”作为一个例子,我想为所有领域的返回值除3号线(因为有一个空值)...
The White House, Pennsylvania Avenue, Washington, 20500
Run Code Online (Sandbox Code Playgroud)
相对于...
The White House, Pennsylvania Avenue, **,** Washington, 20500
Run Code Online (Sandbox Code Playgroud)
我正在尝试将 ACE/JET/MS Access 查询转换为其等效的 Postgresql。在 Access 中,我使用类似于...的 IIF
Select
IIF(line1 <> '', ', ' + line1, '')
+ IIF(line2 <> '', ', ' + line2, '')
+ IIF(line3 <> '', ', …Run Code Online (Sandbox Code Playgroud)