-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
OK, sorry for the lack of info, this is the view I need to have key:
SELECT
CAST(a.bankAccountID AS varchar) + '.' +
CONVERT(varchar, t.creationDate, 112) + '.' +
CONVERT(varchar, t.transactionDate, 112) + '.' +
CAST(t.type AS varchar) + '.' +
CAST(SIGN(t.value) AS varchar) AS
transactionTotalID,
a.bankAccountID,
t.creationDate,
t.transactionDate,
t.type,
SIGN(t.value) AS sign,
SUM(t.value) AS total
FROM
dbo.[Transaction] AS t INNER JOIN
dbo.AccountWithBank AS a ON
t.accountID = a.accountID
WHERE
(NOT (a.bankAccountID IS NULL))
GROUP BY
a.bankAccountID,
t.creationDate,
t.transactionDate,
t.type,
SIGN(t.value)
David Portas wrote:
Quote:
Why can't you just return a key or keys from the base table(s)? Please
post DDL, sample data and your query. It's pretty much impossible to
answer your question properly unless we can see what you are talking
about.
That got me thinking...I can probably go with returning
|
MIN(transactionID) AS transactionTotalID...
I'm still curious as if there's a way to generate an ID (something like
IDENTITY())...
Thanks for the fast response,
Pablo
- --
Pablo Montilla
www.odyssey.com.uy
:USG Unix: /U-S-G yoo'niks/ n.,obs. Refers to AT&T Unix
commercial versions after {Version 7}, especially System III and System V
releases 1, 2, and 3. So called because during most of the lifespan of
those versions AT&T's support crew was called the `Unix Support Group',
but it is applied to version that pre- and post-dated the USG group
but were of the same lineage. This term is now historical. See {BSD},
{{Unix}}.
-- from The on-line Hacker Jargon File V423
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
iD8DBQFEChTTvooSiBfQCSoRAl6WAKCIT4Pk/7umFVJMPjEI6LmX0IDtogCgh6Y7
YwFAh5jwnam2PcIIE24xGEE=
=zAjs
-----END PGP SIGNATURE-----