小编Mav*_*ick的帖子

在postgres中选择行号

如何在postgres中选择行号.

我试过这个:

select
    row_number() over (ORDER BY cgcode_odc_mapping_id)as rownum,
    cgcode_odc_mapping_id
  from access_odc.access_odc_mapping_tb
  order by cgcode_odc_mapping_id
Run Code Online (Sandbox Code Playgroud)

并得到此错误:

ERROR: syntax error at or near "over"
LINE 1: select row_number() over (ORDER BY cgcode_odc_mapping_id)as

我检查过这些页面:如何在PostgreSQL查询中显示行号?


这是我的查询:

 select row_number() over (ORDER BY cgcode_odc_mapping_id)as rownum,cgcode_odc_mapping_id from access_odc.access_odc_mapping_tb order by cgcode_odc_mapping_id 
Run Code Online (Sandbox Code Playgroud)

这是错误:

错误:语法错误在"超过"LINE 1处或附近:选择row_number()over(ORDER BY cgcode_odc_mapping_id)as

sql postgresql window-functions

96
推荐指数
1
解决办法
16万
查看次数

试图连接到mysql并获得错误:不允许连接到由外部主机关闭的MySQL服务器连接

嗨我在ec2中运行两个rhel实例.现在我想做$ telnet ec2-184-73-58-163.compute-1.amazonaws.com 3306

Trying 10.193.139.147...
Connected to ec2-184-73-58-163.compute-1.amazonaws.com.
Escape character is '^]'.
bHost 'domU-12-31-39-05-3D-E6.compute-1.internal' is not allowed to connect to this MySQL serverConnection closed by foreign host.
Run Code Online (Sandbox Code Playgroud)

我是新手.现在没办法做什么?请帮忙.

mysql

11
推荐指数
2
解决办法
5万
查看次数

在RHEL上安装rmagick gem时出错 - 错误:无法构建gem原生扩展

我试图在RHEL上安装snorby.它要求红宝石,我试过,现在我卡住了rmagick错误.

请帮忙.

        Installing rmagick (2.13.1) with native extensions
           Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
            /usr/local/bin/ruby extconf.rb
         checking for Ruby version >= 1.8.5... yes
          extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
          checking for gcc... yes
           checking for Magick-config... yes
    checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
Package MagickCore was not found in the pkg-config search path.

Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable …
Run Code Online (Sandbox Code Playgroud)

ruby rmagick imagemagick

7
推荐指数
1
解决办法
3951
查看次数

使用python安装pdfminer时出现语法错误

我想使用pdfminer来提取文本信息.我已经下载了pdfminer-20131113.我已经安装了python C:\python34.现在使用cmd,我正在设置setup.pypdfminer文件的路径.并运行以下命令.

python setup.py install
Run Code Online (Sandbox Code Playgroud)

但我收到以下错误.

> D:\pdfminer-20101226>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
    from pdfminer import __version__
  File "D:\pdfminer-20101226\pdfminer\__init__.py", line 4
    if __name__ == '__main__': print __version__
                                               ^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)

这似乎是pdfminer的setup.py文件中的一些错误,我不知道如何解决.

另外,我在pdfminer的build文件夹中看到了一个pdf2txt.py文件.我也尝试使用它pdf2txt.py -o output.html pdffilename.pdf(使用完整路径).而不是转换它.它会打开pdf2txt.py文件.

python python-3.x

4
推荐指数
2
解决办法
1万
查看次数

WPF 与 Button 绑定线性渐变属性

我想将渐变属性绑定到按钮。我正在使用下面的代码。我能够绑定样式。你能建议我应该如何绑定linergradientbrush属性吗?

 <Window.Resources>
    <ResourceDictionary>
        <LinearGradientBrush x:Key="buttonStyleGradient"  EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="White" Offset="0" />
            <GradientStop Color="#FFACC3F5" Offset="1" />
        </LinearGradientBrush>
       <Style x:Key="buttonStyle" TargetType="Button">
           <Setter Property="FontFamily" Value="Vrinda"/>
          <Setter Property="FontSize" Value="24"/>
          <Setter Property="Padding" Value="8,4" />
          <Setter Property="Margin" Value="0" />
       </Style>
    </ResourceDictionary>
</Window.Resources><Button  Style="{StaticResource buttonStyle}" >                  
                <Label>Home</Label>
            </Button>
Run Code Online (Sandbox Code Playgroud)

wpf wpf-4.0

2
推荐指数
1
解决办法
4293
查看次数

WPF进度条有不同的颜色

我有警报状态.我想借助颜色在进度条上反映警报状态.如果操作员已将警报处理至30%状态,则进度条将显示30%的颜色,如果操作员已处理至60%.因此,Progress Bar将显示前30%的红色,然后是30%的蓝色.

我将进度条的值设置为30并变为绿色.我的问题是,当我想将它设置为60%时,它将显示前30%的绿色和下一个的红色.

wpf wpf-controls

2
推荐指数
1
解决办法
3495
查看次数

WPF关闭主窗口中的所有窗口

我有登录窗口.从这个登录窗口,我正在初始化主窗口.登录成功后,我关闭登录窗口.现在我有另外两个窗口,我从主窗口调用.一旦我关闭主窗口,我就可以关闭另外两个窗口以及主窗口.但程序仍在内存中运行.我必须从Visual Studio手动关闭它.我该如何完全关闭程序的所有实例?这是主窗口关闭事件代码.

private void usimClose(object sender, EventArgs e)
{
   newScreen2.Close();
   newScreen3.Close();  
   this.Close();                        
}
Run Code Online (Sandbox Code Playgroud)

这是我的登录窗口代码.用户点击提交按钮后.

 private void btnLogin_Click(object sender, RoutedEventArgs e)
 {
        if (txtUserName.Text.Length == 0)
        {
            errormessage.Text = "Please Enter UserName";
            txtUserName.Focus();
        }
        else
        {                
            LoginStatus _status = _Login.LoginUsimgClient(txtUserName.Text, txtPassword.Password.ToString());

            if (_status.BoolLoginstatus)
            {
                mainWindow.RunApplication();
                string struserName = _status.StringUserFirstName;
                mainWindow.userName.Text = "Welcome " + struserName;
                mainWindow.Show();
                this.Close();                    
            }
            else
            {
                errormessage.Text = _status.StringErrorDescription;
                txtUserName.Text = String.Empty;
                txtPassword.Password = String.Empty;
            }
        }
}
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml

0
推荐指数
1
解决办法
6145
查看次数