Forum Moderators: open
What I am tying to do is pull the data from 3 table in SQL2000 DB
what I have is
tableA
tableA_id
tableA_id_tableB_id
tableA_str
tableA_txt
---------------------------------------
tableB
tableB_id
tableB_id_tableA_id
tableB_txt
----------------------------------------
tableC
tableC_id
tableC_Number_from
tableC_Number_to
----------------------------------------
functionA that converts tableA_str to integer
----------------------------------------
What I need is:
tableA_id.*
tableB_txt(if ANY where tableA_id_tableB_id = tableB_id_tableA_id)
tableC_id(if ANY where functionA(tableA_str) between tableC_Number_from and tableC_Number_to)
Thank for your help in advance
SELECT tableA.tableA_id, tableB.tableB_txt, tableC.tableC_id
FROM tableA LEFT OUTER JOIN tableB ON tableA.id_tableB_id = tableB.id_tableA_id
LEFT OUTER JOIN tableC ON functionA(tableA.tableA_str) BETWEEN tableC.Number_from AND tableC.Number_to
[edited by: LifeinAsia at 7:29 pm (utc) on Feb. 16, 2007]