Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT * and SELECT COUNT(*) - different results
Message
 
 
À
12/05/1998 03:19:59
Andrzej Majlich
Vulcan sp. z o. o.
Wroclaw, Pologne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00098482
Message ID:
00099615
Vues:
23
Andrzej,

Running this modified code:

set safety off

set safety off

CREATE TABLE newtable FREE (fld1 C(10))
APPEND BLANK
replace fld1 with "A"
APPEND BLANK
replace fld1 with "B"
DELETE
*Without index on deleted results differ
SET DELETED ON
SELECT * FROM newtable

debugout _tally

SELECT COUNT(*) FROM newtable
debugout query.cnt

*Exception?
SELECT newtable
INDEX ON DELETED() TAG dltd
SELECT * FROM newtable
debugout _tally

SELECT COUNT(*) FROM newtable
debugout query.cnt

Which produces the output
2
2
1
1

I removed the reccount("newtable") because that is always 2 and not particularly relevant to the issue.

The SELECT * both cause browse windows that only display 1 record. Even thought _tally and count(*) return 2 defore the index is created.

I guess I'm equally confused but I'm not a SQL/Rushmore expert. Perhaps someone else can explain it to both of us. *s*

>I've read the topic but it isn't about. I'm not misinterpreting _tally and reccount(). The problem is that the same select (SELECT COUNT(*)) returns two different results - depending on the exsistence of 'deleted' tag.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform