-1
The scenario is as follows: I have my service order tables and my technicians scheduling tables for each service order. The problem is: In my OS table I have, for example, the protocols "123" and "456". In my scheduling table, in my column "ID_OS", I have the following value: "B:123 T:456", this in the same field, because it refers to a scheduling for two products (broadband and telephone).
How is it possible for me to leave my OS table, which will have a row for ID 123 and a row for ID 456 and perform a Join that considers these cases of double products that will appear, in the same column, in the same cell, the values "B:123 T:456" ?
The ideal scenario is for me to bring, in the result, a line for OS 123, with the technician’s information, and a line for OS 456, with the same technical information, but I need these two lines.
Follow SQL Fiddle containing an example of the current state of the database: http://sqlfiddle.com/#! 4/38269b/3
Should OS 789 have only one line as well? Would your result then have three lines with the link data? Can you put an example of how you would like it to be the result of this query.
– Daniel Mendes
It is certainly not a good practice for you to have multivariate attributes in your table. I wouldn’t say it’s impossible for you to do Join but it would be much simpler if the attributes of your table were atomic.
– anonimo
Unfortunately I can’t change the table, I have no power over it and the system already creates that way.
– Hesloan dos Santos Viana
@Danielmendes yes, OS 780 has to have only one line, I put it in the example because it is not all that happen this problem of multivariate attributes. At the end I need three lines: One for each OS containing some data from the technical table.
– Hesloan dos Santos Viana
This would be the expected result: https://i.stack.Imgur.com/T7mhk.png
– Daniel Mendes
@Exact Danielmendes, the OS 123 and 456 with extra information from the table of technicians, which only has one line for these two OS
– Hesloan dos Santos Viana