在我的情况下如何组合多个查询(选定的语句)? [英] how combine multiple query (selected statment) in my case?
本文介绍了在我的情况下如何组合多个查询(选定的语句)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
第一个查询为我提供了表格所需的字段(klass
、Liikmenimi
、synniaeg
、Tiim
等.)
The first query gives me required fields to table (klass
, Liikmenimi
, synniaeg
, Tiim
etc. )
query("
SELECT klass, nimi, synd, teamnimi, start, TIME(`finish`) AS finish FROM bc2014 T1
INNER JOIN bc2014aeg T2 on T1.bc2014_id = T2.bc2014_id
WHERE klass = 'DS1 (1 koera toukerattavedu al.14 a.)' ");
在 phpMyAdmin 中:
in phpMyAdmin with:
select timediff(time(finish), time(start)) AS aeg FROM bc2014aeg
给我表中时间"所需的结果
gives me the required results for "time" in table
我如何合并这两个 - 就我而言?
How can I merge these two - in my case?
推荐答案
您应该能够将字段添加到语句的选择部分
you should just be able to add the fields into the select part of the statement
query("
SELECT
klass, nimi, synd, teamnimi, start,
TIME(`finish`) AS finish,
timediff(time(finish), time(start)) AS aeg
FROM bc2014 T1
INNER JOIN bc2014aeg T2 on T1.bc2014_id = T2.bc2014_id
WHERE klass = 'DS1 (1 koera toukerattavedu al.14 a.)'
");
这篇关于在我的情况下如何组合多个查询(选定的语句)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文