我有两个表[basic]
,[info]
都有一个主键email_id
。现在我想从basic
表中检索信息,但where
子句应该从两个表中都有搜索条件
例子:
SELECT DISTINCT
basic.f_name,
basic.l_name
FROM
basic
CROSS JOIN
info
WHERE
(basic.email_id = basic.email_id)
AND (basic.caste LIKE '%' + @caste + '%')
AND (info.diet = @diet )
(此查询是用 asp 为 gridview 编写的,但它不起作用)