Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memo in simulated left outer join with union
Message
From
02/04/1999 16:43:54
 
 
To
02/04/1999 16:39:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00204806
Message ID:
00204808
Views:
14
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform