Home > Net >  In c # delete
In c # delete

Time:10-12

The delete from student where id=9 and id=8
(0 rows affected)
Why am I that I can't. The syntax should be right. My data is no problem

CodePudding user response:

You what data is the id is September 8

CodePudding user response:

Id=8 have a data id=9 has a data

CodePudding user response:

 delete from student where id=9 OR id=8 

Eldest brother, eldest brother, short-circuit the skull

CodePudding user response:

The
reference 3 floor hanghangz response:
 delete from student where id=9 OR id=8 

Eldest brother, eldest brother, short-circuit the skull
why and not

CodePudding user response:

reference 1/f, f * * KCSDN response:
you what data is the id that is 9 and 8
9 8 is a line of data is also a line of data

CodePudding user response:

Can't write and connection condition, and the meaning of "and" apparently, "and" meaning, how there may be a database data id is equal to 8 and equal to 9 ah, so you'll have to upstairs the methods or, or on behalf of the mean "or", this study now, delete an id for 8 or id for 9 data, of course you also can be used in

CodePudding user response:

Id=9 and id=8

???????????????

Gender=male and gender=female

The estimates only bisexual people conform to the conditions

CodePudding user response:

Database is abstract looked is the line by line to judge (you can think so good, in order to speed up the scanning, database has other optimization, but you can think he abstraction is a large cycle)

So
The foreach (var row in rows)
{
If (rows. Id==8 & amp; & Row. Id==9)
{
//do you think this condition can find
?}
}

CodePudding user response:

Foundation is very important,,, to learn what is logical operation

CodePudding user response:

Id=9 or
id=8You according to the semantic knew, when id==8, 9 and id for?

CodePudding user response:

You use the connection and operator means id=9, should be equal to 8, is obviously impossible

CodePudding user response:

And means and, according to your statement is deleted id=8 and id=9, but how could id can be only one value is 8 and 9,
So it should be the or, id=8, or id=9, then 8 and 9 of the two records will be deleted

CodePudding user response:

Id=9 and id=8, if id of 8, and how is it possible for 9 -_ - if it is to remove and replace or

CodePudding user response:

The annual hot SQL

CodePudding user response:

Topic main train of thought should write
The delete from student where id in (9, 8)

CodePudding user response:

Basic not firm, delete from student where Name='zhang' and Sex='female'
Condition is name is zhang SAN, gender is female of,

CodePudding user response:

You physically or a man and a woman, do you think you can?

CodePudding user response:

Grammar is right, the data may be no problem,
The problem in the logic of your

CodePudding user response:

This is parallel or relationship you this condition of your id to meet at the same time is equal to 8 and 9 this certainly does not have a data or relationship or to achieve what you want to delete the action

CodePudding user response:

The delete from student where id in (8, 9)
Eldest brother, eldest brother, short-circuit the skull

CodePudding user response:

In either the or or in why the and

CodePudding user response:

Imagine that the original poster is the purpose of: delete the id=8 and id=9 records
So, delete statements written: delete from student where id=8 and id=9

But the original poster, the database is not so thinking and execution work task
You can so understand data work: database system to delete statements are interpreted or compiled (word is read after you delete statements), the progressive scan was carried out on the table, if found to be scanned line meet the conditions of the where clause, such records are removed, and then scan the next line, until a full table scan completed

CodePudding user response:

Brother is not to have fun?

CodePudding user response:

I haven't seen any mistake at the beginning,

CodePudding user response:

Equal to 8 and 9 is the intersection at the same time, not 8, 9 and set

CodePudding user response:

I can't see the building Lord reply, don't know understand no,,,

CodePudding user response:

refer to the 6th floor rain stopped reply:
can't write and connection condition, and the meaning of "and" apparently, "and" meaning, how there may be a database data id is equal to 8 and equal to 9 ah, so you have to that method or upstairs, or on behalf of the mean "or", this study now, delete an id for 8 or id for 9 data, of course you also can be used in
OK
I know the thank you

CodePudding user response:

tornado blowing destroyed the parking lot, 9/f, reference response:
basis is important,,, to learn what is logic operations
uh-huh. Thanks

CodePudding user response:

reference 1/f, f * * KCSDN response:
you what data is the id that is 9 and 8
well, I understand. Thanks

CodePudding user response:

Id in (8, 9)

CodePudding user response:

In student Id should be unique, inside this table where the back of the conditions set Id is 9 and is one of the eight rows of data, Id only under the condition of this data doesn't exist,

Where should put at the back of the conditions and the relationship between the (and) changed to and (or) can delete the data you want to delete, can try again oh

CodePudding user response:

& & And | | this to distinguish

CodePudding user response:

Eldest brother, how do you write so I can't, May 9 and 8, is like you are a man and a woman a reason, logic,

CodePudding user response:

 
The delete from student where id=9 OR id=8

CodePudding user response:

For the value of a plastic can't be used in field AND a condition,

 delete from student where id=9 and id=8 


This is a mistake, you

You mean should be deleted=9 or equal to 8 two records, should write

 DELETE FROM student WHERE id=8 OR 9 id=

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C #
  • Related