试试这个
select tblPersonalInfo.companyname, tblJobBudget.title,tblJobBudget.lastmodifiedby,
tblJobAdv.advtitle, tblJobAdv.userId,
tblApplication.advid, tblApplication.position
from tblJobAdv
inner join tblApplication
ON tblJobAdv.advid = tblApplication.advid
inner join tblPersonalInfo
On tblJobBudget.lastmodifiedby = tblPersonalInfo.userid
Run Code Online (Sandbox Code Playgroud)
给出错误
Msg 4104, Level 16, State 1, Line 8
The multi-part identifier "tblJobBudget.lastmodifiedby" could not be bound.
Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "tblJobBudget.title" could not be bound.
Msg 4104, Level 16, State 1, Line 2
Run Code Online (Sandbox Code Playgroud)
无法绑定多部分标识符“tblJobBudget.lastmodifiedby”。
嘿,我正在使用oracle sql来创建数据库.
我现在正在处理查询,我想出了两个单独的quires,我想合并以获得结果.
我创建的第一个查询是查找演出所产生的总金额:
SELECT SUM(bookings * CategoryPrice )AS Total_Money_Made
FROM ( SELECT CategoryPrice , count(*) AS bookings
FROM Booking b
JOIN performance per
ON b.performanceid = per.performanceid
JOIN Production p
ON per.productionid = p.productionid
WHERE per.performanceid IN (1, 2, 3, 4)
GROUP BY CategoryPrice)
Run Code Online (Sandbox Code Playgroud)
这给了我一个结果:
337.5
Run Code Online (Sandbox Code Playgroud)
然后我有另一个查询,计算出总的特许金:
SELECT SUM(ConsessionAmount * 2) AS Total_Consession_Money
FROM( SELECT COUNT (*) AS ConsessionAmount
FROM Booking
WHERE
Consession = 'Yes' AND PerformanceID = '1' OR
Consession = 'Yes' AND PerformanceID = '2' OR …Run Code Online (Sandbox Code Playgroud) 使用 SO 上其他地方的示例来更好地捕获“隐藏”错误。虽然下面的代码将捕获并返回错误,但是否可以改进它以报告发生错误的查询?
使用下面的代码,输出是:
Columns: 18
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FRO inventory' at line 1
Run Code Online (Sandbox Code Playgroud)
正在测试的代码:
$query = "SELECT * FROM orders WHERE location = 'IN' ORDER BY orderNum DESC LIMIT 20;";
$query .= "SELECT * FRO inventory"; // With error
$ord = array();
$invent = array();
if(mysqli_multi_query($link, $query)) {
do {
// fetch results
if($result = mysqli_store_result($link)) …Run Code Online (Sandbox Code Playgroud) php error-handling mysqli multiple-select-query mysqli-multi-query