Multiple table search

Ivan Smahin IvanSmahin at public.kherson.ua
Wed Mar 30 11:07:26 CST 2005


Hello Gregory,

Wednesday, March 30, 2005, 7:16:17 AM, you wrote:

GK> Hello,

GK> This is my first foray into multiple table searches and would greatly
GK> appreciate some guidance.

GK> As an example lets say I have two table with following content: :

GK> aTable

GK> fieldone       fieldtwo
GK> 1001             1002



GK> bTable
GK> fieldthree     fieldfour
GK> 1003             1004

It seems you need just get inner join for two tables. BTW - take a look on our sql-tutorial.
There is detailed description and examples.

But anyway you need some condition which is "join condition". In your example
it might be recIDs - say "first record from first table logically linked to first
record in the second table, and so on..."


GK> I also tried

GK>   whichSearch = "select *  FROM aTable, bTable where atable.fieldtwo =
GK> '"&"1004"&"' OR bTable.fieldfour = '"&"1004"&"' "

GK> and it also crashes.

We check this point - it must be no crashes anyway.


GK> What is the correct syntax?

select *
FROM
    aTable, bTable
where
     atable.fieldtwo = bTable.fieldfour

It's just for INNER JOIN. Or another syntax for same thing is:

select *
FROM
    aTable INNER JOIN bTable ON fieldtwo = fieldfour




GK> _______________________________________________
GK> Valentina mailing list
GK> Valentina at lists.macserve.net
GK> http://lists.macserve.net/mailman/listinfo/valentina



-- 
Best regards,
 Ivan                            mailto:IvanSmahin at public.kherson.ua



More information about the Valentina mailing list