Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Question about joining 2 tables????
Hi everyone,

I have problem to join 2 tables together to show the selected results
into a datagrid.

table1 hosts all customer personal information.
table2 hosts all the trasaction records for each customer

table1 has fields such as "customerID", "CustomerName" and "TelNumber".
(customerID is primary key in table1)

table2 has fields such as "cusomterID", "ComponentPurchase" and
"Quantity"

table1

CustomerID    CustomerName           TelNumber
55                  John             1234566
56                  David             6589211



table2

CustomerID     ComponentPurchase        Quantity
55                    componentA             10
55                    componentB              5
55                    componentC              1
56                    componentA              2


how can i join these two tables and get the result datagrid that list
each customer personal information
and the component he/she purchase listed below his/her personal
information?? such as look like following
one

John      1234566
componentA             10
componentB              5
componentC              1

David     6589211
componentA              2

Could everyone give me some suggestion, or any article i can read?

thanks  for your time

Wing


Report this thread to moderator Post Follow-up to this message
Old Post
Wing
02-25-06 02:28 PM


Re: Question about joining 2 tables????
Wing  wrote:
> Hi everyone,
>
> I have problem to join 2 tables together to show the selected results
> into a datagrid.
>
> table1 hosts all customer personal information.
> table2 hosts all the trasaction records for each customer
>
> table1 has fields such as "customerID", "CustomerName" and
> "TelNumber". (customerID is primary key in table1)
>
> table2 has fields such as "cusomterID", "ComponentPurchase" and
> "Quantity"
>
> table1
>
> CustomerID    CustomerName           TelNumber
> 55                  John             1234566
> 56                  David             6589211
>
>
>
> table2
>
> CustomerID     ComponentPurchase        Quantity
> 55                    componentA             10
> 55                    componentB              5
> 55                    componentC              1
> 56                    componentA              2
>
>
> how can i join these two tables and get the result datagrid that list
> each customer personal information
> and the component he/she purchase listed below his/her personal
> information?? such as look like following
> one
>
> John      1234566
> componentA             10
> componentB              5
> componentC              1
>
> David     6589211
> componentA              2
>
> Could everyone give me some suggestion, or any article i can read?
>
> thanks  for your time
>
> Wing

This is a UI design issue and not a SQL Server one. I assume you know
how to write a SELECT statement that joins two tables together. How that
information is evenutally displays in the UI depends on what controls
you are using and your code. This is not really a SQL issue. Many data
grids support a parent-child style layout, but that's a question for
another group.

--
David Gugick - SQL Server MVP
Quest Software


Report this thread to moderator Post Follow-up to this message
Old Post
David Gugick
03-01-06 01:23 AM


Re: Question about joining 2 tables????
Thanks for your comment

Wing


Report this thread to moderator Post Follow-up to this message
Old Post
Wing
03-01-06 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 05:08 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006