‎2009 Mar 17 6:14 AM
hi friends,
can we use where clause in select statement with inner join.
i am using following code which gives error (The column name "WERKS" has two meanings . .).
SELECT AMATNR ACHARG AERSDA BMENGE B~MEINS
FROM MCHA AS A INNER JOIN CHVW AS B
ON ACHARG = BCHARG
INTO TABLE T_OUTPUT1
WHERE WERKS = PLANT AND CHARG = P_CHARG.
thanks.
‎2009 Mar 17 6:16 AM
Yes you can use, the probelm below is both tables has werks and you have to specify which tables.
So in the where condition if you give A-WERKS OR B-WERKS should solve the problem
Mathews
‎2009 Mar 17 6:16 AM
Yes you can use, the probelm below is both tables has werks and you have to specify which tables.
So in the where condition if you give A-WERKS OR B-WERKS should solve the problem
Mathews
‎2009 Mar 17 6:19 AM
Yes you can use it.
In the above where clause give
A-WERKS OR B-WERKS and
A-CHARG OR B-CHARG.
Cheers,
Surinder
‎2009 Mar 17 6:20 AM
Yes u can use where clause in select statement with inner join.
SELECT AMATNR ACHARG AERSDA BMENGE B~MEINS
FROM MCHA AS A INNER JOIN CHVW AS B
ON ACHARG = BCHARG
INTO TABLE T_OUTPUT1
WHERE WERKS = PLANT AND CHARG = P_CHARG.
" mention the table name in where condition also like awerks or bwerks.
egards
Rajendra
‎2009 Mar 17 6:21 AM
SELECT A~MATNR A~CHARG A~ERSDA B~MENGE B~MEINS
FROM MCHA AS A INNER JOIN CHVW AS B
ON A~CHARG = B~CHARG
INTO TABLE T_OUTPUT1
WHERE *A~*WERKS = PLANT AND *A~*CHARG = P_CHARG.Try to use the above code.
regards,
~Satya
‎2009 Mar 17 6:24 AM
Hi Bupi Kaler,
You can use where condition.
Here problem is you could use AWERKS OR BWERKS instead of WERKS and
ACHARG or BCHARG instead of CHARG in where condition.
It will solve your problem.
by
Prasad GVK