Re: Stuck on creating an easy view, please help

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Anith Sen (anith_at_bizdatasolutions.com)
Date: 09/08/04


Date: Wed, 8 Sep 2004 15:23:07 -0500


>> Or do you know of a better way to get the result I want?

Yup. First, you have to reconsider your design. Since multiple values are
concatenated to form a string for the team, your design suffers from severe
logical problems inherent to multi-valued systems. A reasonable approach,
based on your narrative would be to have the tables like:

CREATE TABLE Requests (
     Request_id INT NOT NULL,
     Team_id INT NOT NULL
          REFERENCES Teams ( Team_id )
      PRIMARY KEY ( Request_id, Team )
     );
CREATE TABLE Teams (
     Team_id INT NOT NULL PRIMARY KEY ,
     Descr VARCHAR(10) NOT NULL
     ) ;

You can have your data like:

INSERT Requests SELECT 240, 2 ;
INSERT Requests SELECT 240, 3 ;
INSERT Requests SELECT 241, 1 ;
INSERT Requests SELECT 242, 1 ;
INSERT Requests SELECT 242, 2 ;
INSERT Requests SELECT 242, 3 ;

INSERT Teams SELECT 1, 'SC' ;
INSERT Teams SELECT 2, 'PE' ;
INSERT Teams SELECT 3, 'CO' ;

Most query expressions using SQL would be trivial with such a schema & what
you are requesting is no different. However, if you are looking for a
concatenated string as your output, I would recommend you extract the
resultset & do the concatenation leveraging the client programming
language's string manipulation functions.

-- 
Anith 


Relevant Pages

  • RE: Need Help with Page can not be displayed form my web service
    ... Thanks Dan. ... I didn't go for submitting and polling because all requests are ... will making the call to web service asynchronous ... > convert this design to a batch that gets kicked off behind the scenes. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: B2B problem
    ... He has information system which receives various order requests from ... The customers requests exist from some meta-data (quantity, ... I'm looking to design some generic web service solution which will ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: How to design an abitration cicuit related to interrupt controller
    ... very hard for such a beginner like me to design. ... how to design a fix-prority arbitration circuit whose specification is ... be met due to high speed (high clock frequency). ... requests arrive in arbitrary time sequences. ...
    (sci.electronics.design)
  • Re: Web Application Design Patterns
    ... all I'm trying to figure out a general design for a web application ... where a Servlet handles all the requests that have to do with either ... Some actions that can be performed to it depending on the context ... So for example the Servlet should be responsible for, ...
    (comp.lang.java.programmer)
  • Re: instanceof NOT (always) bad? The instanceof myth.
    ... I thought you said Microsoft didn't do design by committee? ... They may have requested certain features, but Microsoft was free to ignore those requests. ...
    (comp.lang.java.programmer)