0

I' ve a SQLite table called WPList with 4 column

ID (int), ID_quote (int foreign key), ID_workperformance (int foreign key), expire_date (text)

I' ve a big problem when I try to eliminate a row with this query:

DELETE FROM WPList WHERE ID_workperformance = 12 & ID_quote = 21

I' m absolutely sure that ID_workperformance 12 and ID_quote 21 exist in table but when I execute this query nothing happen. Can you help me please? Thanks!!

1 Answer 1

3

It's AND, not &.

DELETE FROM WPList WHERE ID_workperformance = 12 AND ID_quote = 21 

it seems & is equivalent but a little harder to use, as in you need to add brackets in your case

DELETE FROM WPList WHERE ((ID_workperformance = 12) & (ID_quote = 21)) 

Without the backet, the execution plan (see EXPLAIN) of your syntax is the same as

DELETE FROM WPList WHERE (ID_workperformance = 12 & ID_quote) = 21 

which explains why it does not work as expected.

Sign up to request clarification or add additional context in comments.

1 Comment

@DominiqueJacquel, well put. :-)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.