Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dbchud
Starting Member
13 Posts |
Posted - 2009-08-21 : 05:34:35
|
HiI am trying to build a query that gives me the following:item name table name---------------code table1accountid table1accountid2 table2balance table3I want to select one distinct code with one accountid, something like this:code accountid accountid2 balancecodea 1 111 50codeb 2 222 51codec 3 333 52coded 4 444 53I have the results via individual queries, then adding the union clause - but this now results in one massive query and I suspect it doesn't need to be like that. Hopefully that's enough info, would appreciate any help/ tips. If you need more pls advise.CheersGary |
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2009-08-21 : 21:17:03
|
without the tables, data and required output you are not going to get much help. Maybe it's clear to others but I can't understand what you start with nor what you want. |
|
|
dbchud
Starting Member
13 Posts |
Posted - 2009-08-25 : 05:43:55
|
No worries, couldn't quite explain in the post above. Think I figured it out, cheers anyway :) |
|
|
|
|
|