Jump to content

selecting only specific info from a table


bkana

Recommended Posts

Hello all,I'm new to this particular forum, so bear with me.I have the following table called "Info":companyname Address boothnumber boothspace A 11 s st. A 1 100 B 22 b st. B 2 200 I use the following statment:Select companyname, Address, boothnumber, boothspaceFrom InfoWhen I run this it gives two results for the same company, the address and then the boothnumber and boothspaceHow do I combine the output so that I can have the companyname, address, boothnumber and boothspace all on the same line? In other words, how do I pull the company name once, it's address, boothnumber and bothspace when the data is in different rows?Thanks in advance? B

Link to comment
Share on other sites

Hello all,I'm new to this particular forum, so bear with me.I have the following table called "Info":companyname Address boothnumber boothspace A 11 s st. A 1 100 B 22 b st. B 2 200 I use the following statment:Select companyname, Address, boothnumber, boothspaceFrom InfoWhen I run this it gives two results for the same company, the address and then the boothnumber and boothspaceHow do I combine the output so that I can have the companyname, address, boothnumber and boothspace all on the same line? In other words, how do I pull the company name once, it's address, boothnumber and bothspace when the data is in different rows?Thanks in advance? B
You can try SELECT companyname, Address, boothnumber, boothspace FROM info WHERE companyname = 'CompanyX'I'm not sure if that is what you are trying to do. :)
Link to comment
Share on other sites

Hello all,I'm new to this particular forum, so bear with me.I have the following table called "Info":companyname Address boothnumber boothspace A 11 s st. A 1 100 B 22 b st. B 2 200 I use the following statment:Select companyname, Address, boothnumber, boothspaceFrom InfoWhen I run this it gives two results for the same company, the address and then the boothnumber and boothspaceHow do I combine the output so that I can have the companyname, address, boothnumber and boothspace all on the same line? In other words, how do I pull the company name once, it's address, boothnumber and bothspace when the data is in different rows?Thanks in advance? B
companyname		Address			  boothnumber			   boothspace			  	 A					   11 s st.													 	 A													 1								 100	 B					   22 b st.																 B													 2								 200

Sorry about the first post, I had to include "code" to properly display what I was talking about.

You can try SELECT companyname, Address, boothnumber, boothspace FROM info WHERE companyname = 'CompanyX'I'm not sure if that is what you are trying to do. :)
Thanks Cronthenoob, I'll give that a try. I may have to post the actual table I am using so that it makes more sense.
companyname		Address			  boothnumber			   boothspace			  	 A					   11 s st.													 	 A													 1								 100	 B					   22 b st.																 B													 2								 200

Sorry about the first post, I had to include "code" to properly display what I was talking about.Thanks Cronthenoob, I'll give that a try. I may have to post the actual table I am using so that it makes more sense.

Actaully, there are hundreds of company names in this table that I need this info for. And, the company name might be listed more then twice for other information. One row could hold the address, one could hold the contact at the company, and an another could hold the boothnumber and boothspace. I need to pull the company name once, while also pulling the address, contact name and booth info. Hope that made sense.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...