We help IT Professionals succeed at work.

SQL comparision probelm?

lbseong
lbseong asked
on
I have to select the database dta to compare with other maskedit box..if the data from the table is use by other user then i cant delete the maskedit data..
eg..
table:
name   user
aa     test
bb     test1
cc     test2
dd
ee

if i want to delete aa,i cant delete it cause it is use by test, but if i want to delete dd,ee, i can cause it didnt use by other..
so how to do the caompare and do the delete thing..the sql command..and also the procedure pls..thanks.
Comment
Watch Question

Technical Director
BRONZE EXPERT
Commented:
1. This SQL deletes ALL records where User is blank:
DELETE FROM Table WHERE User IS NULL

2. This SQL will delete a record matching the text you have entered, unless User has a value:

DELETE FROM Table WHERE (name = 'aa') AND (User IS NULL)

J.
lbseong:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
BRONZE EXPERT

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept jsweby's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.