SELECT DISTINCT a~guid_cdoc INTO TABLE po_guids FROM cdoc AS a
INNER JOIN rat AS b ON a~guid_cdoc = b~guid_cdoc
FOR ALL ENTRIES IN pi_guids
WHERE ( a~guid_cdoc = pi_guids-guid_cdoc
( SELECT DISTINCT d~giud_rat FROM rat AS d (
INNER JOIN ord AS e ON d~guid_ord = e~guid_ord )
Select DISTINCT f~guid_ord FROM ord AS f
JOIN rep AS g ON f~guid_rep = g~guid_rep
JOIN order AS h ON f~guid_order = h~guid_order
WHERE g~name = 'Test_Name' ) ) ).
SELECT DISTINCT cdoc~guid_cdoc
INTO TABLE po_guids
FROM rep
INNER JOIN ord ON ord~guid_rep = rep~guid_rep
INNER JOIN rat ON rat~guid_ord = ord~guid_ord
INNER JOIN cdoc ON cdoc~guid_cdoc = rat~guid_cdoc
FOR ALL ENTRIES IN pi_guids
WHERE rep~name = 'NAME'
AND cdoc~guid_cdoc = pi_guids-guid_cdoc
.
А вообще можно не включать табл. cdoc вытягивать только из rat.
Еще не понятна суть задачи. Вы фильтруете по тому же полю что и выбираете.
Age: 48 Joined: 25 Jan 2008 Posts: 580 Location: Москва
Posted: Thu Aug 25, 2011 6:13 pm Post subject:
Да, и забудьте про 3NF при работе с SAP - здесь при проектировании БД упор делается на быстродействие запросов, а не на уменьшение избыточности данных. _________________ С уважением,
Удав.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.