如何在php

时间:2016-05-10 06:46:19

标签: php mysql sql

我的SQL Server数据库中有两个表。第一个是bidder_interest_name,第二个是tender_type_subcatbidder_interest_subcategory中有多个值列bidder_interest_nametender_type_subcategory表中有tender_type_subcat

现在我想从两个表中为特定子类别选择多个值,并且需要两个表最小匹配值。

这就是我正在做的事情

我尝试过:

SELECT bi.bidder_interest_subcategory,tt.tender_type_subcategory 
FROM bidder_interest_list as bi,new_tender_two as tt 
WHERE bi.bidder_id=$bidder_id

2 个答案:

答案 0 :(得分:1)

试试这个

SELECT bi.bidder_id, bi.bidder_interest_subcategory,tt.tender_type_subcategory FROM bidder_interest_list as bi,new_tender_two as tt WHERE bi.bidder_id=$bidder_id;

答案 1 :(得分:0)

试试这个:SELECT bi.bidder_id=tt.tender_id, bi.bidder_interest_subcategory,tt.tender_type_subcategory FROM bidder_interest_list as bi,new_tender_two as tt WHERE bi.bidder_id=bidder_id;