Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table test_w (cnt int, empl varchar(50), id int); ------------------------------------------------------ insert into test_w values (20, 'Π‘Π»Π΅ΡΠ°Ρ€ΡŒ', 2); insert into test_w values (30, 'ΠœΠΎΠ½Ρ‚Π°ΠΆΠ½ΠΈΠΊ', 2); insert into test_w values (20, 'ΠœΠΎΠ½Ρ‚Π°ΠΆΠ½ΠΈΠΊ', 3); insert into test_w values (50, 'Π£Π±ΠΎΡ€Ρ‰ΠΈΠΊ', 3); insert into test_w values (20, 'Π”ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€', 1); create table test_m (zarplata int, empl2 varchar(50), id int); insert into test_m values (12000, 'Π‘Π»Π΅ΡΠ°Ρ€ΡŒ',2); insert into test_m values (22000, 'ΠœΠΎΠ½Ρ‚Π°ΠΆΠ½ΠΈΠΊ',2); insert into test_m values (32000, 'Π£Π±ΠΎΡ€Ρ‰ΠΈΠΊ',3); insert into test_m values (12000, 'Π”ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€',0); select t1.*, t2.* --t2.empl as emp1 from test_m t2 left join test_w t1 --left join test_w t1 on (t1.empl <> t2.empl2 and t1.id <> t2.id) --and t2.id with (2,1)) --where t2.id =2

Stuck with a problem? Got Error? Ask AI support!

Copy Clear