Oracle join query

Posted by Jasim on Stack Overflow See other posts from Stack Overflow or by Jasim
Published on 2010-06-17T11:10:50Z Indexed on 2010/06/17 11:13 UTC
Read the original article Hit count: 261

Filed under:
|
|
|

There are three tables in my db ITEM_MASTER, PRICE_MASTER, COMP_MASTER

ITEM_MASTER
STORE_CODE  ITEM_CODE  ITEM_DESC
   011         914004   desccc

PRICE_MASTER
STORE_CODE  ITEM_CODE  COMP_CODE
   011         914004     01 
   011         914004     02
   011         914004     03
   011         914004     04

COMP_MASTER
COMP_CODE   COMP_DESC   STORE_CODE
   01        comp1         011
   02        comp2         011
   03        comp3         011
   04        comp4         011 

I want to get all these for an ITEM_CODE in single query

  STORE_CODE ITEM_CODE ITEM_DESC COMP_DESC1 COMP_DESC2 COMP_DESC3 COMP_DESC4
     011       914004     desccc   comp1      comp2       comp3      comp4

How can i write a oracle SQL query for this??

© Stack Overflow or respective owner

Related posts about sql

Related posts about database