我正在尝试使用postgresql进行查询.该数据库包含两个关系:"王国",其中包括一些英国国王,以及"dinasty",其中包含一些来自斯图亚特恐怖的人
关系"王国"包括国王的名字,当他的王国开始和结束时."dinasty"的关系包括姓名,性别,出生和死亡.
我想要查询的是他去世时最年长的国王.
根据我的查询,我在LINE 3(NOT IN)收到此错误: subquery has too many columns
这是查询:
SELECT kingdom.king, dinasty.birth, dinasty.death
FROM kingdom, dinasty
WHERE kingdom.king = dinasty.name AND kingdom.king NOT IN
(
SELECT DISTINCT R1.king, R1.birth, R1.death
FROM
(
SELECT DISTINCT R1.king, D1.birth, D1.death
FROM kingdom AS R1, dinasty AS D1, dinasty AS D2
WHERE R1.king=D1.name
) AS R1,
(
SELECT DISTINCT R1.king, D1.birth, D1.death
FROM kingdom AS R1, dinasty AS D1, dinasty AS D2
WHERE R1.king=D1.name
) AS R2
WHERE R1.death-R1.birth < R2.death-R2.birth …Run Code Online (Sandbox Code Playgroud) 当我尝试用HTML编译游戏时,我遇到了一个奇怪的问题.(我搜索了其他主题,他们指的是进口非法包裹的人,我不是.)
所以基本上,在我的主要包中调用的每个类都在我的主包之外调用了这个错误.这些类都是由我实现的,他们不会导入任何非法的东西(没有反射,没有I/O,只有自制类和jbox2d).似乎它忽略了导入或类似的东西.
为了测试这个,我创建了一个名为Test的空类.当它在我的主要包装中时我没有得到任何错误,而当我把它移到外面时,我得到了:
[INFO] [ERROR]第73行:没有源代码可用于类型progetto.saga.map.Test; 你忘了继承一个必需的模块吗?
在第73行,我就是这么做的 Test test = new Test()
这是我的.gwt.xml文件:
<module rename-to='theknowledgetower'>
<inherits name='playn.PlayN'/>
<inherits name='TheKnowledgeTowersAssets'/>
<source path='core'/>
<source path='html'/>
<public path="resources" />
<entry-point class='progetto.saga.html.TheKnowledgeTowersHtml'/>
</module>
Run Code Online (Sandbox Code Playgroud)
你们有什么想法吗?
编辑:这是我得到的错误(我在我的主程序包之外的主类中的每个自定义类都得到它)
[INFO] [ERROR] Line 53: No source code is available for type progetto.saga.navigable.Navigable; did you forget to inherit a required module?
[INFO] [ERROR] Line 59: No source code is available for type progetto.saga.entity.dynamicentity.Player; did you forget to inherit a required module?
[INFO] [ERROR] Line 110: No source code is available …Run Code Online (Sandbox Code Playgroud) 我真的很抱歉这个其他的菜鸟问题,但我无法弄清楚这里发生了什么.我想计算文件中单词的频率,其中单词是逐行的.该文件非常大,所以这可能是问题(在这个例子中它计数300k行)
我执行此命令:
cat .temp_occ | uniq -c | sort -k1,1nr -k2 > distribution.txt
Run Code Online (Sandbox Code Playgroud)
问题是它给了我一个小小的错误:它认为我的语言不同.例如,第一个条目是:
306 continua
278 apertura
211 eventi
189 murah
182 giochi
167 giochi
Run Code Online (Sandbox Code Playgroud)
你可以看到,与giochi重复两次
在文件的底部它变得更糟,它看起来像这样:
1 win
1 win
1 win
1 win
1 win
1 win
1 win
1 win
1 win
1 winchester
1 wind
1 wind
Run Code Online (Sandbox Code Playgroud)
对于所有的话
对于这个愚蠢的问题,我真的很抱歉,但我有点贝壳编程的菜鸟.我究竟做错了什么?
非常感谢
我很抱歉这个非常棒的问题,但我对bash编程很新(几天前开始).基本上我想要做的是保留一个文件与另一个文件的所有单词出现
我知道我可以这样做:
sort | uniq -c | sort
Run Code Online (Sandbox Code Playgroud)
事情是,之后我想要第二个文件,再次计算出现次数并更新第一个.我拿第三个文件后依此类推.
我现在正在做什么没有任何问题(我正在使用grep,sed和awk),但它看起来很慢.
我很确定只有一个命令左右有一个非常有效的方法,使用uniq,但我无法弄清楚.
你能以正确的方式引导我吗?
我也粘贴了我写的代码:
#!/bin/bash
# count the number of word occurrences from a file and writes to another file #
# the words are listed from the most frequent to the less one #
touch .check # used to check the occurrances. Temporary file
touch distribution.txt # final file with all the occurrences calculated
page=$1 # contains the file I'm …Run Code Online (Sandbox Code Playgroud) 我需要一些正则表达式的帮助:我试图检查一个句子是否包含一个特定的单词.
让我们以此主题的标题为例:
"正则表达式在字符串中查找特定单词"
我需要找到它是否包含单词if,在这种情况下它是假的.
我不能使用方法contains,因为在这种情况下它会返回true(spec*if*ic)
我正在考虑使用方法匹配,但我有点正规表达式的菜鸟.
基本上,匹配方法的输入中的正则表达式需要指定正在查找的单词之前和单词之后的字符不是字母(因此它不能包含在该单词中)或单词是在句子的开头或结尾
非常感谢!
我正在尝试使用多个条件执行for循环,但我没有找到有关如何在Web上执行此操作的任何信息
我很抱歉这些愚蠢的问题,但我刚开始用linux编程
我在这做错了什么?
#!/bin/bash
j=0
for line in `cat .temp_` || j in `seq 0 19`
do
...
done
Run Code Online (Sandbox Code Playgroud)
错误说错误的语法,我不能使用||
非常感谢