mysql - Edit query with join union tables - unwanted column in result -
i need edit sql query display in result every column except stuffid. column stuffid join purpose.
select * stuff join ( select stuffid , salary , hiredate , laptop , car employee union select stuffid , round(manager.salary + (manager.salary * cast(bonus float) / 100), 2) salary , hiredate , laptop , car manager ) people on stuff.id = people.stuffid order stuff.id
list columns want in select:
select stuff.col1, stuff.col2, . . ., people.salary, people.hiredate, people.laptop, people.car . . . if want stuffid appear once, 1 method is:
select stuff.*, people.salary, people.hiredate, people.laptop, people.car another method use using instead of on.
Comments
Post a Comment