D
D
Dmitry_Fe2019-02-05 15:12:37
SQL
Dmitry_Fe, 2019-02-05 15:12:37

SQL output new table after joining two on multiple parameters LEFT OUTER JOIN?

Good afternoon!
I am taking my first steps in SQL, the task is to replace the VLOOKUP (EXEL) functionality in two parameters, since Excel cannot cope with a large data array.
Got the code

SELECT test.`18ur`.`Наименование потребителя` , test.`18ur`.`Номер абонента` , test.`32`. `Состояние потребителя`, test.`32`.`№ куратора`
  
    FROM test.`18ur`
LEFT OUTER JOIN test.`32`
    ON test.`18ur`.`Номер абонента` = test.`32`.`Номер абонента` WHERE test.`32`.`Состояние потребителя` LIKE ('%ликвидирован%') AND test.`32`.`№ куратора` LIKE ('%ро%')

where from two tables 18ur and 32 (test folder) a comparison is made by the parameter Subscriber number, consumer status and employee name, at the output I get
5c597d857ec68132077664.png
Attention question: it is
necessary to save a new table based on the output, saving only one line with the subscriber number. Search did not help, please help, thanks in advance!
upd: I understand that you can save the desired column in the format, upload exel using dbForge, and then load it and refer to this file, but I would not want such crutches

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question