H
H
hunteramg2017-03-31 11:02:16
MySQL
hunteramg, 2017-03-31 11:02:16

How to form a SQL select query for 730 rows?

Greetings! Please help me with database queries.
There are 2 tables with more than 4000 entries.
There are 730 values ​​for which you need to:
1) Select all 'USER_ID's from the `accounts` table where the 'XML_ID' field = a list of 730 items...;
2) Delete all rows from the `accounts` table where the 'XML_ID' field = a list of 730 pieces...;
2) Delete all rows from the `user` table where 'ID' = saved list in item 1 of 730 pieces...
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2017-03-31
@d-stream

In any convenient way, we fill in a certain temporary table with the xml_id and user_id columns with the same xml_id,
then we update this table - fill in the user_id
and then delete from ... where xml_id in (select xml_id from temp)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question