views:

8

answers:

0

I have this domain problem: one table with this column "id,name,cubicleId" and another table with "id,date,name,numbers"

the actual key to connect the two table is secondtable.name=firsttable.cubicle.name+"_"+firsttable.name

actually the two tables are not related because my domain problem is "I want to get the single row with maximum date less than THISDATE for the name THISNAME"

So in second table I have more row for the same name but with different dates.

How can I connect tables together so I can change name on first table mantaining relation on rows?

related questions