Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select a deleted flag
Message
 
 
To
03/04/2009 19:30:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01393204
Message ID:
01393415
Views:
38
>How can I create a field via SELECT that will identify the record as deleted in the original table (r1)? This is my SELECT but del1 comes up false regardless of the record's original status.
>
>
>select r1.system, r1.rtp_id, trim(r1.st_name) + " / " + trim(r1.termini) as st_name_a, r1.lead, ;
>r2.rtp_id, trim(r2.st_name) + " / " + trim(r2.termini) as st_name_b, r2.lead, ;
>r3.rtp_id, trim(r3.st_name) + " / " + trim(r3.termini) as st_name_c, r3.lead, ;
>deleted() as del1 ;
>from rtp_projects r1 ;
>left join rtp_projects r2 on r1.rtp_id = r2.parentproject ;
>left join rtp_projects r3 on r2.rtp_id = r3.parentproject ;
>where (r1.parentproject = 0 or isnull(r1.parentproject)) and ! isnull(r1.st_name) and ! isblank(r1.st_name);
>order by r1.system, r1.st_name, r2.st_name, r3.st_name
>
>
>Thanks

The only way to correctly transfer the deleted flag is to use one table select as derived table and only then join with the rest of the tables.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform