如果我中创建一个别名select子句然后我不能在使用where条款,因为根据SQL查询的执行顺序where之前来select.
但我可以创建在一个别名select子句和它的使用having条款,虽然having来之前select.
为什么会这样?
例如:
select type, (case when number>25 then 1 else 0 end) inc
from animals
where inc='1';
Run Code Online (Sandbox Code Playgroud)
这不行.但,
select type, (case when number>25 then 1 else 0 end) inc
from animals
having inc='1';
Run Code Online (Sandbox Code Playgroud)
这有效.为什么这样?
我包装了EJB,我需要包括从依赖到罐子一些.classes,我试图使用Maven的依赖,插件解压神器将文件放在我的$ {project.build.directory在包阶段期间/ classes目录,但是当我执行mvn包时,我没有看到任何日志或对maven-dependency-plugin的引用(没有任何反应),我甚至尝试使用无效版本的插件,它甚至没有抛出异常.
在我的pom.xml下面
....
<packaging>ejb</packaging>
<name>myapp</name>
...repository and props
<build>
<pluginManagement>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>unpack</id>
<phase>package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.myapp</groupId>
<artifactId>model</artifactId>
<version>1.0.0</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<includes>**/shared/*.class</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.myapp</groupId>
<artifactId>model</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
PS:工件模型安装在本地仓库中,我也尝试过其他阶段.