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 |
Dzuverink
Starting Member
2 Posts |
Posted - 2013-01-31 : 11:22:14
|
I am have a database that contians stores and all of the stores attributes. What I am trying to do is pull store numbers based on a particular attribute. However this particular attribute has 27 different possibilities and I want to run a query that reports back each distinct attribute with the stores numbers listed under each result. I have gotten this to work but it is returning each distinct attribute onto a seperate result tab.This is the basic SQL that I am starting with (I am working in Navicat SQL Server desktop)SELECT MailerUId As AEFROM "Wawa 012113"WHERECAT LIKE 'AE' |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-31 : 12:23:48
|
post some sample data and explain what you want as outut. Otherwise we cant make out much from your explanation------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Dzuverink
Starting Member
2 Posts |
Posted - 2013-01-31 : 12:41:28
|
I thought I did explain. Copied from initial question as to what I want as it appears you missed it... I want to run a query that reports back each distinct attribute with the stores numbers listed under each resultThis is what is being output when I writeSELECT MailerUId As AEFROM "Wawa 012113"WHERECAT LIKE 'AE'SELECT MailerUId As BEFROM "Wawa 012113"WHERECAT LIKE 'BE'Result 1 (first tab)AE6Result 2 (second tab)BE486This is what I would like to return all on one result tabAE BE6 486 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|