Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Use Conditional Delete using SQL
Message
 
 
To
28/02/2014 14:31:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01595554
Message ID:
01595556
Views:
40
>Hi,
>
>I have a cursor with three columns. Detail, POSC, POSR
>I am Deleting records from it like This
>
>
>Delete From ABC  Where ;			
>			posC=0 Or ;
>			posR=0 Or ;
>			posR>posRTOPMOSTVALUE Or ;
>			GETWORDNUM(POS,Getwordcount(Alltrim(POS))-3)='(Page'
>
>
>
>I want to Delete Based on above critera, however I Do not want to Delete one record having Detal="ENDP" although it is having corresponding value of posR=0 or posC=0
>
>i.e I want to delete all posc, posr etc based on above but not the record having DETAIL="ENDP"
>
>What additional condition I need to Add on the above
>
>Regards
>
>
>
>
>
>
>Using the above SQL for Delete
Delete From ABC  Where ;			
			(posC=0 Or ;
			posR=0 Or ;
			posR>posRTOPMOSTVALUE Or ;
			GETWORDNUM(POS,Getwordcount(Alltrim(POS))-3)='(Page') AND NOT Detail = 'ENDP'
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform