Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UNION Doesn't work
Message
De
16/10/2005 13:59:34
 
 
À
16/10/2005 10:44:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01059492
Message ID:
01059508
Vues:
12
>Hi:
>
>When I run the second SELECT I have no problem, but when I run it UNIONed with the first I get an error 'Command is missing required clause'
>
>What am I doing wrong?
>
>Thanx -
>
>Yossi
>
>
>SELECT lm_lotnum FROM it!lottmplt ;
>	UNION ;
>	SELECT TOP 1 lm_lotnum ;
>	FROM it!lotmast ;
>	ORDER BY 1 DESC ;
>	INTO CURSOR results
>
Yossi,

I think that the TOP n clause applies to the whole query.

If you put it first there is no error. But then, you may not get the result you intended
create cursor pp ( pp I )
local i
for i = 1 to 5
	insert into pp values(m.i)
endfor
	

select top 7 pp ;
	from pp ;
order by 1 ;
union all ;
select	pp-10 ;
	from pp
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform