我正在尝试进行两个select
查询,以便第二个选择必须基于第一个。我给第一个表名“t1”并尝试根据第一个进行第二次选择,但最后我得到数据库错误。
SQL
SELECT startpoli_i ,
finalpoli_i ,
prosfora ,
comments_pro ,
accepted ,
onoma01 ,
epitheto01 ,
email01 ,
tilefono01 ,
weight1 ,
depdate1 ,
specialservices1 ,
comments1 ,
username01
FROM (offers ,registration1 ,customer) t1
WHERE (
offers.string_uniq regexp concat( :str)
AND registration1.username01 = offers.user_i
AND customer.startpoli1 = offers.startpoli_i
AND customer.finalpoli1 = offers.finalpoli_i )
UNION
SELECT startpoli_i ,
finalpoli_i ,
prosfora ,
comments_pro ,
accepted ,
onoma01 ,
epitheto01 ,
email01 ,
tilefono01 ,
weight1 ,
depdate1 ,
specialservices1 ,
comments1 ,
username01
FROM offers ,
registration1 ,
customer
WHERE offers.startpoli_i = t1.startpoli_i
AND offers.finalpoli_i = t1.finalpoli_i
我很确定该错误与我使用表名 t1 的方式有关。任何建议;