MariaDB查询中“字段列表”中的未知列

时间:2019-03-12 20:18:15

标签: sql jpa jpa-2.0 jpql

我正在尝试将这些SQL查询重写为JPQL:

SELECT  `payment_transactions`.* 
FROM `payment_transactions` 
INNER JOIN `wpf_payment_payment_transactions` 
    ON `payment_transactions`.`id` = `wpf_payment_payment_transactions`.`payment_transaction_id` 
WHERE `wpf_payment_payment_transactions`.`wpf_payment_id` = 75  
ORDER BY `payment_transactions`.`id` ASC 
LIMIT 1


SELECT `payment_transactions`.* 
FROM `payment_transactions` 
INNER JOIN `wpf_payment_payment_transactions` 
    ON `payment_transactions`.`id` = `wpf_payment_payment_transactions`.`payment_transaction_id` 
WHERE `wpf_payment_payment_transactions`.`wpf_payment_id` = 75

我试图实现这一点:

SELECT t 
FROM payment_transactions t 
INNER JOIN wpf_payment_payment_transactions wppt 
    ON t.id = wppt.payment_transaction_id
WHERE wppt.wpf_payment_id = 1 
ORDER BY t.id ASC 
LIMIT 1

但是我得到了错误:

  

“字段列表”中的未知列“ t”

您知道我该如何解决吗?

0 个答案:

没有答案