Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT * and SELECT COUNT(*) - different results
Message
 
 
To
12/05/1998 03:19:59
Andrzej Majlich
Vulcan sp. z o. o.
Wroclaw, Poland
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00098482
Message ID:
00099615
Views:
22
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
Previous
Reply
Map
View

Click here to load this message in the networking platform