SQL Query Problem.
-
Hello, I have a problem building a query. There is a Master table with fields. ItemID[int][PK] Description1[text] Description2 [text] 1 "Any desc" "Any Desc" 2 " " " " and then there is a child table. ID[int] ItemID[int] CustomerID[int] 1 1 546 2 1 546 3 1 534 4 2 545 the two table are inner-joined with ItemID. I want to getthe data from two, but The Items selected should't repeat i.e. should be grouped by ItemID. I have problems in this bec Description fields are text in this case. So can anyone help me in this ? Looking forward to hearing from you. The problem is that i want to get just the Regards, Asim
-
Hello, I have a problem building a query. There is a Master table with fields. ItemID[int][PK] Description1[text] Description2 [text] 1 "Any desc" "Any Desc" 2 " " " " and then there is a child table. ID[int] ItemID[int] CustomerID[int] 1 1 546 2 1 546 3 1 534 4 2 545 the two table are inner-joined with ItemID. I want to getthe data from two, but The Items selected should't repeat i.e. should be grouped by ItemID. I have problems in this bec Description fields are text in this case. So can anyone help me in this ? Looking forward to hearing from you. The problem is that i want to get just the Regards, Asim
I don't know that I understand you correctly. You want to INNER JOIN the master and child table, but you don't want to repeat the ItemID (the join column) because it will return duplicate text columns? I am somewhat curious as to what format you want the data in. Performing joins tends to produce denormalised output and you cannot really get away from that. The best way that I can think of is to do two queries, one to join the tables but not return the text columns, and another to return just the text columns.
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More