Bitte helfen Sie mirWie mehrere SQL-Server-Tabellen
Ich habe abfragen:
DECLARE @tbl1 TABLE(idfish INT)
INSERT INTO @tbl1 (idfish)
VALUES (10), (11), (12)
DECLARE @tbl2 TABLE(kindid INT)
INSERT INTO @tbl2 (kindid)
VALUES (1), (2)
SELECT * FROM @tbl1
SELECT * FROM @tbl2
Nun, ich Ergebnis will, muss zwei Spalten Tabelle (idfish, kindid) als:
10 1 ;11 1; 12 1; 10 2; 11 2; 12 2
Nach ';' als neue Zeile
Vielen Dank!
Mögliche Duplikat [Wie kann eine SQL-Abfrage Rückgabedaten aus mehreren Tabellen] (http://stackoverflow.com/questions/12475850/how- can-an-sql-query-return-data-from-multiple-tables) – mkilmanas