Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.26 KB | None | 0 0
  1. select tb1.*, tb2.* from tabela as tb1
  2. inner join tabela as tb2 on tb1.item_superior_id = tb2.item_id
  3.  
  4.  
  5. select tb1.*, (select tb2.nome_item from tabela as tb2
  6.             where tb2.item_id = tb1.item_superior_id) as `Nome Item Superior`
  7. from tabela as tb1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement