Answer the question
In order to leave comments, you need to log in
How to correctly set the SQL script?
Two tables:
<i>1. equipment </i>
id_eq Первичный int(11)
name varchar(120)
sn varchar(25)
invn varchar(14)
type_eq varchar(25)
location varchar(25)
note1 varchar(120)
<i>2. moving_eq2</i>
id_mov Первичный int(11)
name_eq varchar(120)
id_eq int(11)
datetime date
fio1 varchar(50)
fio2 varchar(50)
fioIT varchar(50)
note
SELECT name, sn, invn, type_eq, location, note1
FROM equipment AS t1
WHERE id_eq NOT IN
(SELECT * FROM moving_eq2 AS t2
WHERE t1.id_eq = t2.id_eq)
Answer the question
In order to leave comments, you need to log in
SELECT name, sn, invn, type_eq, location, note1
FROM equipment
LEFT JOIN moving_eq2 ON moving_eq2.id_eq = equipment.id_eq
WHERE moving_eq2.id_eq IS NULL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question