-1

我正在尝试从中获取数据,awards_bookings_table但由于某种原因,我在下面的行中遇到了错误,我 100% 确定它与我编码的内容:)

目标:

我只想拉出表的结果:大于的awards_booking_ticketsticket_quantity0

主要加盟:

`LEFT JOIN `awards_bookings_tickets` bookings_tickets ON bookings.awards_booking_id = bookings_tickets.booking_id`

问题代码:

我试图做以下事情:

LEFT JOIN `awards_bookings_tickets` bookings_tickets ON bookings.awards_booking_id = bookings_tickets.booking_id WHERE booking_tickets.ticket_quantity > 0
4

2 回答 2

1

只需用于AND组合子句,即:

 INNER JOIN `awards_bookings_tickets` bookings_tickets ON bookings.awards_booking_id = bookings_tickets.booking_id AND booking_tickets.ticket_quantity > 0
于 2013-03-19T21:20:19.827 回答
0

你试过用WHERE吗?

 WHERE booking_tickets.ticket_quantity > 0
于 2013-03-19T21:21:45.973 回答