Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting too much rows...
Message
De
19/03/2002 10:39:53
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00634449
Message ID:
00634478
Vues:
24
>Good morning.
>I am running a SQL statement that returns too much rows... even if I have a where criteria, it does not take out the records !
>
>There is it.
>SELECT calias, count(calias) as ncount, coption FROM curpos2 where alltrim(curpos2.coption)='O' GROUP BY calias, coption INTO CURSOR curtmpstock
>
>I get this :
>CALIAS, NCOUNT, COPTION
>"AMNG" 2 empty
>"AMNG" 3 "O"
>"AOL" 2 empty
>"AOL" 5 "O"
>
>Why does this SQL statement keep the empty COPTION ?
>
>I am using VFP7 SP1.

Either set ansi on or use == operator.

ie:
create cursor mycursor (myvalues c(10))
for ix = 1 to 10
	insert into myCursor values ('O'+trans(ix))
endfor
insert into myCursor values ('O')
insert into myCursor values ('')

set ansi off
select * from myCursor where myvalues = 'O'
select * from myCursor where alltrim(myvalues) = 'O'
select * from myCursor where myvalues == 'O'
select * from myCursor where alltrim(myvalues) == 'O'

set ansi on
select * from myCursor where myvalues = 'O'
select * from myCursor where alltrim(myvalues) = 'O'
select * from myCursor where myvalues == 'O'
select * from myCursor where alltrim(myvalues) == 'O'
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform