Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select I need to understand
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01496256
Message ID:
01496257
Views:
92
This message has been marked as the solution to the initial question of the thread.
The result is impossible for the query and data you posted.
Most likely there're multiple records with PK=230 in one of tables or both.

>
>I am having a tough time understanding why the following query returns 6 rows for the PK_FLD = 230? Here are the two tables:
>
>Table A
>PK_FLD ID_NAME
>230 ABC
>510 ABC
>511 ABC
>512 ABC
>
>TableB
>PK_FLD
>230
>510
>512
>511
>722
>
>
>select TABLEA.PK_FLD FROM TABLEA JOIN TABLEB ON TABLEA.PK_FLD = TABLEB.PK_FLD
>WHERE TABLEA.ID_NUMBER = "ABC"
>
>
>I thought that the resulting query should have 4 rows but what is returned is:
>230
>230
>230
>230
>230
>230
>510
>511
>512
>
>Could someone explain why? TIA
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform