asked on
tcache_b_active
bsourceId int(11) PK
bId int(11) PK
ipAddress varchar(45)
custId int(11)
channel varchar(10)
bType varchar(5)
bPlacedTime datetime
bReceivedTime datetime
amount double
numLegs int(11)
tcache_b_leg_active
bsourceId int(11) PK
bId int(11) PK
globalId int(11) PK
tag varchar(45)
tcache_customer
bsourceId int(11) PK
customerId int(11) PK
userName varchar(100)
firstName varchar(45)
lastName varchar(45)
custRegCode varchar(45)
custIsElite tinyint(1)
custRegPostCode varchar(45)
custRegEmail varchar(150)
countryCode varchar(10)
tcache_b_details_active
globalId int(11) PK
Name varchar(120)
description varchar(120)
startTime datetime
result varchar(1)
select
a.*,b.*,c.*,d.* from
tcache_b_active a, tcache_customer b, tcache_b_leg_active c, tcache_b_details_active d
where
a.custId = b.customerId
and
a.bsourceId = b.bsourceId
and
a.bsourceId = c.bsourceId
and
c.globalId = d.globalId
and
a.bId in
(
select bId from tcache_b_leg_active where globalId = $INPUT$
);