, Guest>> || || |
/ Microsoft SQL Server
 sql   [new]
nc1318
Member

:
: 13
:

CounterPartyID INT
PRIMARY KEY IDENTITY [Name] VARCHAR(255) IsActive BIT
1 1
2 0
3 1
CounterPartyID
[Name]
IsActive


TransID INT TransDate DATE RcvID INT SndID INT AssetID INT Quantity NUMERIC(19, 8)
1 01.01.2012 1 2 1 100
2 02.01.2012 1 3 2 150
3 03.01.2012 3 1 1 300
4 04.01.2012 2 1 3 50
TransID
TransDate
RcvID
SndID
AssetID (, , , ..)
Quantity

: , , .

:
SELECT A.CounterPartyID, A.Name, w.AssetID
FROM dbo.accounts A
JOIN dbo.wirings w ON A.CounterPartyID = w.RcvID
WHERE IsActive = 1
UNION ALL
SELECT A.CounterPartyID, A.Name, w.AssetID
FROM dbo.accounts A
JOIN dbo.wirings w ON A.CounterPartyID = w.SndID
WHERE IsActive = 1

,
10 19, 09:16[21905674]      |
 Re: sql   [new]

Member

:
: 3459
?

. ? ?
10 19, 09:18[21905676]      |
 Re: sql   [new]
nc1318
Member

:
: 13

)
10 19, 09:33[21905693]      |
 Re: sql   [new]

Member

:
: 3459
nc1318

)


, ? ,
10 19, 14:14[21905939]      |
 Re: sql   [new]
nc1318
Member

:
: 13
,

,
14 19, 11:59[21993555]      |
/ Microsoft SQL Server