Ich habe 2 Tabellen:Wählen Sie einen Spaltenkopf gleichen Namen und Anzeigedaten horizontal
1-Verträge SQL Ausgabe wie dieses Ergebnis
contracts_id | subject_contract
001 | name
002 | name
2-contracts_files
contracts_id | file_data
001 | 1image <varbinary(MAX)>
002 | 1image <varbinary(MAX)>
001 | 2image <varbinary(MAX)>
002 | 2image <varbinary(MAX)>
brauchen:
contracts_id | subject_contract | file_data | file_data
001 | name | 1image | 2image
002 | name | 1image | 2image
Ich versuche, diese
SELECT Contracts.[contracts_id]
,Contracts.[subject_contract]
,contracts_files.[filedata]
FROM Contracts , contracts_files
where contracts_files.contracts_id = Contracts.contracts_id
AND Contracts.contracts_id=' 001 '
aber das Ergebnis war:
contracts_id | subject_contract | file_data
001 | name | 1image
001 | name | 2image
Wie mache ich es mit 'FOR LOOP' oder mit 'CASE'?
Also, Sie eine Lösung mit CASE fragen sind, und akzeptieren dann eine Antwort, die nicht verwenden, nicht es? –