Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memo in simulated left outer join with union
Message
De
02/04/1999 16:43:54
 
 
À
02/04/1999 16:39:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00204806
Message ID:
00204808
Vues:
13
>I've been using a lot of union clauses in my sql lately to simulate left outer joins (btw, thanks, Mr. Levy).
>
>So basically my syntax has been:
> Select invent.item_id, items.desc ;
> from invent, items ;
> where invent.item_id = items.item_id ;
> union ;
> select invent.item_id, " " as desc ;
> from invent ;
> where invent.item_id not in (select item_id from items)
>
>(but you guys knew that already, didn't you :) ).
>
>So now I find myself needing to do a union where the "placeholder" (" " as desc in the example above) is a memo field. What do I use for a placeholder for something like that?
>
>Thanks!

The usual trick is following:
CREATE CURSOR tmp1 (dummy M)
Insert Into tmp1 Values('')
Select *,tmp1.dummy as Mymemo From Mytable,tmp1

You may use the last line as part of UNION. Also, I think you may better use UNION ALL working with memos.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform