General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>Hi, everybody!
>
>I need your help... I'm with a problem that is ocurring also with some other friends (and with some other, not)...
>
>Do as follows:
>
>* Create a table called Test1 with the structure:
>Field: iID
>Type: Integer
>
>* Create a table called Test2 with the structure:
>Field: iID
>Type: Integer
>
>* Create any FOR/NEXT to fill these tables with some 1000 records
>For example:
>SELE TEST1
>FOR i=1 TO 1000
> appen blank
> repl all iID with recno()
>ENDFOR
>
>Do this in both tables.
>
>Well, these two table has the same structure and the same content (records and value)
>
>Now, run the following command:
>
>SELECT * FROM TEST1 WHERE IID NOT IN (SELECT IID FROM TEST2)
>
>We're trying to descover which records is in the Test1 and don't have a corresponding record in Test2. It must return Zero records, because they're exact the same. However, here comes the problem: in my SQL, returns a cursor with the folling records: 17, 253, 509 and 765. Do you see? It begun with 17, and goes adding 256... 17+256=253... 253+256=509.. etecera...
>
>After did a lot of attempts, I resolved to change the type of field IID of table Test2, to Numeric 4,0... well, it does work... I'm sure that it's a problem with Integer Fields.
>
>Could anybody explain this for me?
>
>Thanks in Advance
>
>[]'s
>
>Lassala
>It must return Zero records
And it does for me.
Mark
PS. I tested with cursors
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only