SQL to combine columns

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve London

    SQL to combine columns

    I'm sure this has been brought up many times, but I will ask anyway.

    Let's say I have 2 tables related:

    Owner:
    ---------
    o_id
    o_name

    Dog:
    ---------
    d_id
    d_name
    o_id - for Owner table.

    If the data is laid out as

    o_id o_name
    1 John

    d_id d_name o_id
    1 Skippy 1
    2 Fido 1

    How can I make a query that will produce the following results:

    o_id o_name owned dog names
    1 John Skippy, Fido

    I think it has something to do with unions but I can't seem to get it. I'm
    using SQL Server Compact Edition.


  • Erland Sommarskog

    #2
    Re: SQL to combine columns

    Steve London (sylondon@opton line.net) writes:
    Let's say I have 2 tables related:
    >
    Owner:
    ---------
    o_id
    o_name
    >
    Dog:
    ---------
    d_id
    d_name
    o_id - for Owner table.
    >
    If the data is laid out as
    >
    o_id o_name
    1 John
    >
    d_id d_name o_id
    1 Skippy 1
    2 Fido 1
    >
    How can I make a query that will produce the following results:
    >
    o_id o_name owned dog names
    1 John Skippy, Fido
    >
    I think it has something to do with unions but I can't seem to get it.
    I'm using SQL Server Compact Edition.
    There isn't any straight-forward way of doing this. It is possible do this
    one statement with a quirk of XML as in this example:

    select CustomerID,
    substring(OrdId List, 1, datalength(OrdI dList)/2 - 1)
    -- strip the last ',' from the list
    from
    Customers c cross apply
    (select convert(nvarcha r(30), OrderID) + ',' as [text()]
    from Orders o
    where o.CustomerID = c.CustomerID
    order by o.OrderID
    for xml path('')) as Dummy(OrdIdList )
    go

    I don't know if all this syntax is available, in Compact Edition, though.
    (While called SQL Server, it's an entirely different engine.)

    Else you will have run a cursor to achieve this result.




    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server 2005 at

    Books Online for SQL Server 2000 at

    Comment

    • Plamen Ratchev

      #3
      Re: SQL to combine columns

      "Erland Sommarskog" <esquel@sommars kog.sewrote in message
      news:Xns98EDF17 7951DAYazorman@ 127.0.0.1...
      >
      I don't know if all this syntax is available, in Compact Edition, though.
      (While called SQL Server, it's an entirely different engine.)
      >
      Else you will have run a cursor to achieve this result.
      >
      I had to work with the Compact Edition recently and it supports really a
      limited set of T-SQL. There are no stored procedures, user functions,
      control of flow constructs (like IF..ELSE, but CASE is available), views,
      triggers, and cursors. None of the new ranking functions for SQL 2005 are
      available as well as the XML specific handling (like FOR XML). Also, CROSS
      APPLY is not supported, and no DECLARE for variables...

      It is really "compact" and to keep it that way it has only the basic query
      support of the database engine (and I mean really basic - I could not even
      use derived tables in FROM and subqueries in the SELECT list). For all other
      functionality it depends on the rich functionality of ADO.NET and/or your
      application layer. So, probably the best way to approach this problem is to
      solve it in the application logic.

      HTH,

      Plamen Ratchev



      Comment

      • yuri

        #4
        Re: SQL to combine columns

        Yea, I already do it in the Application Layer. It was just a passing fancy
        to remove some code and let SQL do it.

        I think I sent you an email accidently. Just delete it. Sorry about that.
        Windows Mail is so stupid. I really need to switch.

        "Plamen Ratchev" <Plamen@SQLStud io.comwrote in message
        news:TadIh.1078 6$tD2.396@newsr ead1.news.pas.e arthlink.net...
        "Erland Sommarskog" <esquel@sommars kog.sewrote in message
        news:Xns98EDF17 7951DAYazorman@ 127.0.0.1...
        >>
        >I don't know if all this syntax is available, in Compact Edition, though.
        >(While called SQL Server, it's an entirely different engine.)
        >>
        >Else you will have run a cursor to achieve this result.
        >>
        >
        I had to work with the Compact Edition recently and it supports really a
        limited set of T-SQL. There are no stored procedures, user functions,
        control of flow constructs (like IF..ELSE, but CASE is available), views,
        triggers, and cursors. None of the new ranking functions for SQL 2005 are
        available as well as the XML specific handling (like FOR XML). Also, CROSS
        APPLY is not supported, and no DECLARE for variables...
        >
        It is really "compact" and to keep it that way it has only the basic query
        support of the database engine (and I mean really basic - I could not even
        use derived tables in FROM and subqueries in the SELECT list). For all
        other functionality it depends on the rich functionality of ADO.NET and/or
        your application layer. So, probably the best way to approach this problem
        is to solve it in the application logic.
        >
        HTH,
        >
        Plamen Ratchev

        >
        >

        Comment

        • Erland Sommarskog

          #5
          Re: SQL to combine columns

          Plamen Ratchev (Plamen@SQLStud io.com) writes:
          I had to work with the Compact Edition recently and it supports really a
          limited set of T-SQL. There are no stored procedures, user functions,
          control of flow constructs (like IF..ELSE, but CASE is available), views,
          triggers, and cursors. None of the new ranking functions for SQL 2005 are
          available as well as the XML specific handling (like FOR XML). Also, CROSS
          APPLY is not supported, and no DECLARE for variables...
          But, it has at least one thing big brother does not have: ALTER TABLE
          syntax to add/remove the IDENTITY property. I find it amazing.

          --
          Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

          Books Online for SQL Server 2005 at

          Books Online for SQL Server 2000 at

          Comment

          • Plamen Ratchev

            #6
            Re: SQL to combine columns

            :) Good catch!

            I guess it makes sense to give a little more power in some areas to
            compensate for others. There are some sides of the Compact Edition that make
            it very attractive (in particular situations). I like that it has a very
            small footprint (only 7 DLLs) and it can be installed via copying the DLLs
            to the application directory (that way no administrative privileges
            required). Also, supports the ADO.NET Sync Framework, allows to have the
            database file on a network share, and to some degree higher safety (since it
            does not support T-SQL procedural code). And if the OLE DB provider is used
            then no need to install the .NET 2.0 Framework. So, a good addition to the
            family...

            Plamen Ratchev




            Comment

            • --CELKO--

              #7
              Re: SQL to combine columns

              >I'm sure this has been brought up many times, but I will ask anyway. <<

              Yes it is brought up all the time because people will not bother to
              read even one book on RDBMS, so they keep asking this kind of thing
              over and over. Please post DDL, so that people do not have to guess
              what the keys, constraints, Declarative Referential Integrity, data
              types, etc. in your schema are. Let's start by doing what you should
              have done for us:

              CREATE TABLE Owners -- plural if you have more than one
              (owner_id INTEGER NOT NULL PRIMARY KEY,
              owner_name CHAR(20) NOT NULL);

              CREATE TABLE Dogs -- plural if you have more than one
              (dog_id INTEGER NOT NULL PRIMARY KEY,
              dog_name CHAR(20) NOT NULL);

              Why did you think that an owner is an attribute of a dog? It is a
              relationship! It might have attributes of its own, like license
              numbers, issue date, etc. but let's ignore that.

              CREATE TABLE Ownership-- plural if you have more than one
              (owner_id INTEGER NOT NULL
              REFERENCES Owners(owner_id )
              ON UPDATE CASCADE
              ON DELETE CASCADE,
              dog_id INTEGER NOT NULL
              REFERENCES Dogs(dog_id)
              ON UPDATE CASCADE
              ON DELETE CASCADE,
              PRIMARY KEY (dog_id, owner_id));
              >How can I make a query that will produce the following results: <<
              Why do you wish to destroy First Normal Form (1NF) with a concatenated
              list structure? It is the foundation of RDBMS, after all. See why I
              say you never read a book on RDBMS.

              Why are you formatting data in the back end? The basic principle of a
              tiered architecture is that display is done in the front end and never
              in the back end. This is a more basic programming principle than just
              SQL and RDBMS.

              Yes, trhre are some proprietary, stinking kludges that can do this.
              But do you want to be a good SQL programmer instead?

              Comment

              • yuri

                #8
                Re: SQL to combine columns

                But do you want to be a good SQL programmer instead?

                No, I want to be the worst programmer on the planet. I mean really.
                Yes it is brought up all the time because people will not bother to
                read even one book on RDBMS, so they keep asking this kind of thing
                over and over. Please post DDL, so that people do not have to guess
                what the keys, constraints, Declarative Referential Integrity, data
                types, etc. in your schema are. Let's start by doing what you should
                have done for us:
                Oh, I'm sorry about that. I failed to get a copy of the CELKO SQL posting
                etiquette. Could you please point me in the right direction?
                Sarcasm aside, I will do this in the future. Thanks.
                Why do you wish to destroy First Normal Form (1NF) with a concatenated
                list structure? It is the foundation of RDBMS, after all. See why I
                say you never read a book on RDBMS.
                You're right I should have went out and bought a book on RDBMS. I mean who
                would ever think about asking a question on the internet was possible. I
                mean everybody should shut down all forums and rely on tech manuals because
                they are always so well written and contain every piece of knowledge on the
                planet about the subject, including all the hidden tips and tricks.
                Questions will be a thing of the past. Just grab a book and your answer
                will be there. Did you get criticized in class when you had a question
                about something? Did the teacher yell at you, tell you to read the book and
                never answer the question?

                Since, my application is small and does very basic SQL usage, the internet
                provided all the information I needed, but a book would have answered my
                question so the might CELKO would not have been bothered. I guess I figured
                there are some decent people out there that would be willing to help out
                somebody new to the RDBMS world, thank you proving me wrong. Others, seem
                just fine. Maybe you need to relax and not get so worked up over a
                question. I mean if it bothers you that much you might want to take a
                vacation and relax buddy before your next heart attack.
                Why did you think that an owner is an attribute of a dog? It is a
                relationship! It might have attributes of its own, like license
                numbers, issue date, etc. but let's ignore that.
                Why are you formatting data in the back end? The basic principle of a
                tiered architecture is that display is done in the front end and never
                in the back end. This is a more basic programming principle than just
                SQL and RDBMS.
                Thank you for all you criticism and posting how I failed to put license
                numbers, issue date, and any other things for you. I tried to make it small
                and simple for the example. I guess for CELKO it was a very, very poor
                example.

                I think a dog belongs to an owner. Can an owner have more than 1 dog?
                Hmmm.... I think so in this example. Yes, creating a seperate table in this
                example to handle 1 to many is politically correct but I wasn't asking to be
                critiqued on correctness but for a simple answer to a simple question. I
                already handle this in my application but it was a passing fancy to see if
                it was possible to do in SQL to better my knowledge. Thanks for not
                anwering my question and making a noob to RDBMS feel welcome. I appreciate
                it!!!

                Maybe, the great CELKO can recommend a book and help out a newly RDBMS
                programmer into this world instead of criticising each and every word and
                never help out except to say how bad and wrong the post was.

                Steve London (Yuri)


                "--CELKO--" <jcelko212@eart hlink.netwrote in message
                news:1173533747 .995999.210930@ s48g2000cws.goo glegroups.com.. .
                >>I'm sure this has been brought up many times, but I will ask anyway. <<
                >
                Yes it is brought up all the time because people will not bother to
                read even one book on RDBMS, so they keep asking this kind of thing
                over and over. Please post DDL, so that people do not have to guess
                what the keys, constraints, Declarative Referential Integrity, data
                types, etc. in your schema are. Let's start by doing what you should
                have done for us:
                >
                CREATE TABLE Owners -- plural if you have more than one
                (owner_id INTEGER NOT NULL PRIMARY KEY,
                owner_name CHAR(20) NOT NULL);
                >
                CREATE TABLE Dogs -- plural if you have more than one
                (dog_id INTEGER NOT NULL PRIMARY KEY,
                dog_name CHAR(20) NOT NULL);
                >
                Why did you think that an owner is an attribute of a dog? It is a
                relationship! It might have attributes of its own, like license
                numbers, issue date, etc. but let's ignore that.
                >
                CREATE TABLE Ownership-- plural if you have more than one
                (owner_id INTEGER NOT NULL
                REFERENCES Owners(owner_id )
                ON UPDATE CASCADE
                ON DELETE CASCADE,
                dog_id INTEGER NOT NULL
                REFERENCES Dogs(dog_id)
                ON UPDATE CASCADE
                ON DELETE CASCADE,
                PRIMARY KEY (dog_id, owner_id));
                >
                >>How can I make a query that will produce the following results: <<
                >
                Why do you wish to destroy First Normal Form (1NF) with a concatenated
                list structure? It is the foundation of RDBMS, after all. See why I
                say you never read a book on RDBMS.
                >
                Why are you formatting data in the back end? The basic principle of a
                tiered architecture is that display is done in the front end and never
                in the back end. This is a more basic programming principle than just
                SQL and RDBMS.
                >
                Yes, trhre are some proprietary, stinking kludges that can do this.
                But do you want to be a good SQL programmer instead?
                >

                Comment

                • othellomy@yahoo.com

                  #9
                  Re: SQL to combine columns

                  On Mar 9, 3:43 am, "Steve London" <sylon...@opton line.netwrote:
                  I'm sure this has been brought up many times, but I will ask anyway.
                  >
                  Let's say I have 2 tables related:
                  >
                  Owner:
                  ---------
                  o_id
                  o_name
                  >
                  Dog:
                  ---------
                  d_id
                  d_name
                  o_id - for Owner table.
                  >
                  If the data is laid out as
                  >
                  o_id o_name
                  1 John
                  >
                  d_id d_name o_id
                  1 Skippy 1
                  2 Fido 1
                  >
                  How can I make a query that will produce the following results:
                  >
                  o_id o_name owned dog names
                  1 John Skippy, Fido
                  >
                  I think it has something to do with unions but I can't seem to get it. I'm
                  using SQL Server Compact Edition.
                  hi,
                  Following code will work but you might have to customize it to fit
                  your requirement.

                  declare @table table (o_id int, o_name varchar(50))
                  declare @dog table (d_id int, d_name varchar(50),o_i d int)
                  declare @owner_dogs table(o_id int, o_name varchar(50), d_name
                  varchar(50))
                  insert @table values (1,'John')
                  insert @dog values(1,'Skipp y',1)
                  insert @dog values(2,'Fido' ,1)

                  declare @dog_name varchar(50)

                  while (select count(*) from @dog) 0
                  begin
                  set rowcount 1
                  if @dog_name is null
                  begin
                  select @dog_name = d_name
                  from @dog
                  where o_id = 1
                  end
                  else
                  select @dog_name = @dog_name + ', ' + d_name
                  from @dog
                  where o_id = 1

                  delete @dog
                  end

                  insert @owner_dogs values(1,'John' ,@dog_name)
                  select * from @owner_dogs
                  set rowcount 0

                  Comment

                  • othellomy@yahoo.com

                    #10
                    Re: SQL to combine columns

                    On Mar 12, 2:43 pm, othell...@yahoo .com wrote:
                    On Mar 9, 3:43 am, "Steve London" <sylon...@opton line.netwrote:
                    >
                    >
                    >
                    >
                    >
                    I'm sure this has been brought up many times, but I will ask anyway.
                    >
                    Let's say I have 2 tables related:
                    >
                    Owner:
                    ---------
                    o_id
                    o_name
                    >
                    Dog:
                    ---------
                    d_id
                    d_name
                    o_id - for Owner table.
                    >
                    If the data is laid out as
                    >
                    o_id o_name
                    1 John
                    >
                    d_id d_name o_id
                    1 Skippy 1
                    2 Fido 1
                    >
                    How can I make a query that will produce the following results:
                    >
                    o_id o_name owned dog names
                    1 John Skippy, Fido
                    >
                    I think it has something to do with unions but I can't seem to get it. I'm
                    using SQL Server Compact Edition.
                    >
                    hi,
                    Following code will work but you might have to customize it to fit
                    your requirement.
                    >
                    declare @table table (o_id int, o_name varchar(50))
                    declare @dog table (d_id int, d_name varchar(50),o_i d int)
                    declare @owner_dogs table(o_id int, o_name varchar(50), d_name
                    varchar(50))
                    insert @table values (1,'John')
                    insert @dog values(1,'Skipp y',1)
                    insert @dog values(2,'Fido' ,1)
                    >
                    declare @dog_name varchar(50)
                    >
                    while (select count(*) from @dog) 0
                    begin
                    set rowcount 1
                    if @dog_name is null
                    begin
                    select @dog_name = d_name
                    from @dog
                    where o_id = 1
                    end
                    else
                    select @dog_name = @dog_name + ', ' + d_name
                    from @dog
                    where o_id = 1
                    >
                    delete @dog
                    end
                    >
                    insert @owner_dogs values(1,'John' ,@dog_name)
                    select * from @owner_dogs
                    set rowcount 0- Hide quoted text -
                    >
                    - Show quoted text -
                    Hi,
                    I just read your complete post and realized that you might not be able
                    to get it working. So here is the complete code:

                    declare @table table (o_id int, o_name varchar(50))
                    declare @dog table (d_id int, d_name varchar(50),o_i d int)
                    declare @owner_dogs table(o_id int, o_name varchar(50), d_name
                    varchar(50))

                    declare @dog_temp table (d_id int, d_name varchar(50),o_i d int)
                    declare @id table (o_id int)

                    insert @table values (1,'John')
                    insert @table values (2,'Mary')

                    insert @dog values(1,'Skipp y',1)
                    insert @dog values(2,'Fido' ,1)
                    insert @dog values(3,'Ralph ',2)
                    insert @dog values(4,'Alf', 2)

                    declare @dog_name varchar(50)
                    declare @o_id int

                    insert @id
                    select distinct o_id
                    from @table

                    select @o_id = max(o_id) from @id
                    --select top 1 @o_id = o_id from @id

                    while @o_id is not null
                    begin
                    delete @id
                    where o_id = @o_id

                    insert @dog_temp
                    select *
                    from @dog
                    where o_id = @o_id

                    select @dog_name = null
                    while (select count(*) from @dog_temp) 0
                    begin
                    set rowcount 1
                    if @dog_name is null
                    begin
                    select @dog_name = d_name
                    from @dog_temp
                    where o_id = @o_id
                    end
                    else
                    select @dog_name = @dog_name + ', ' + d_name
                    from @dog_temp
                    where o_id = @o_id

                    delete @dog_temp
                    end

                    insert @owner_dogs (o_id,d_name)
                    values (@o_id,@dog_nam e)

                    set rowcount 0

                    select @o_id = max(o_id) from @id
                    end


                    update @owner_dogs
                    set o_name = a.o_name
                    from @table a,
                    @owner_dogs b
                    where b.o_id = a.o_id

                    select * from @owner_dogs

                    Comment

                    • Ed Murphy

                      #11
                      Re: SQL to combine columns

                      yuri wrote:
                      >Yes it is brought up all the time because people will not bother to
                      >read even one book on RDBMS, so they keep asking this kind of thing
                      >over and over. Please post DDL, so that people do not have to guess
                      >what the keys, constraints, Declarative Referential Integrity, data
                      >types, etc. in your schema are. Let's start by doing what you should
                      >have done for us:
                      >
                      Oh, I'm sorry about that. I failed to get a copy of the CELKO SQL
                      posting etiquette. Could you please point me in the right direction?
                      Sarcasm aside, I will do this in the future. Thanks.
                      He's pretty much always like that. You get used to it after a while.
                      >Why do you wish to destroy First Normal Form (1NF) with a concatenated
                      >list structure? It is the foundation of RDBMS, after all. See why I
                      >say you never read a book on RDBMS.
                      >
                      You're right I should have went out and bought a book on RDBMS. I mean
                      who would ever think about asking a question on the internet was
                      possible. I mean everybody should shut down all forums and rely on tech
                      manuals because they are always so well written and contain every piece
                      of knowledge on the planet about the subject, including all the hidden
                      tips and tricks. Questions will be a thing of the past. Just grab a
                      book and your answer will be there. Did you get criticized in class
                      when you had a question about something? Did the teacher yell at you,
                      tell you to read the book and never answer the question?
                      This is not a class. It's reasonable to expect people to do at least
                      a bit of reading on their own first.
                      >Why did you think that an owner is an attribute of a dog? It is a
                      >relationship ! It might have attributes of its own, like license
                      >numbers, issue date, etc. but let's ignore that.
                      >
                      I think a dog belongs to an owner. Can an owner have more than 1 dog?
                      Hmmm.... I think so in this example. Yes, creating a seperate table in
                      But can a dog have more than one owner? If so, then the relationship
                      should indeed be moved into a third table.

                      This (among many other issues) is the sort of thing that questioners
                      tend to gloss over, not because they haven't thought about it, but
                      because the answer is obvious to them (whereas it is not obvious to
                      the rest of us). Politeness issues aside, I think it's a net gain
                      for such issues to be pointed out pre-emptively.

                      Comment

                      • yuri

                        #12
                        Re: SQL to combine columns

                        This is not a class. It's reasonable to expect people to do at least
                        a bit of reading on their own first.
                        The questions were in reference to me being a student asking for help from
                        more experienced users. If CELKO, the teacher, acted like that then there
                        must have been a reason, hence the class reference.

                        <Sarcasm>
                        Oh right, reading books!! Yes, I never thought of that. I should smack
                        myself over the head. Jeez... Let me pull some imaginary money out of my
                        butt, go to the store and grab the $40-$50 dollar book. (No library
                        reference please).
                        </Sarcasm>

                        I have found all the information on the internet, not from books or
                        schooling(SQL and RDBMS). Did you or CELKO crawl out of the womb and say,
                        "I am the Master at X, and you will bow before me". I don't think so,
                        therefore you must have done reading, schooling and for heaven sakes, you
                        ASKED questions from more experienced people at some point. Didn't you? You
                        have to start somewhere.

                        I guarantee I know something you or CELKO don't, and does it make it right
                        for me to criticize you if you ask a question that is very obvious to me?
                        No.

                        Yes, CELKO is a Master at RDBMS, I have just started out and have done very
                        well in only a few days. So, I cannot ask any questions until I become
                        extremely proficient at RDBMS and SQL! Huh... Tough group. ;)

                        Ok, that's over with. Now, let's drink to good times. ;)

                        Please, can you at least recommend a good book that is for intermediate to
                        advanced, in regards to SQL and RDBMS, recent copyright date please? I will
                        spare the money and buy it.

                        I think I accidently posted to: comp.databases. ms-sqlserver.maste rlevel. ;)


                        "Ed Murphy" <emurphy42@soca l.rr.comwrote in message
                        news:45f585f7$0 $5777$4c368faf@ roadrunner.com. ..
                        yuri wrote:
                        >
                        >>Yes it is brought up all the time because people will not bother to
                        >>read even one book on RDBMS, so they keep asking this kind of thing
                        >>over and over. Please post DDL, so that people do not have to guess
                        >>what the keys, constraints, Declarative Referential Integrity, data
                        >>types, etc. in your schema are. Let's start by doing what you should
                        >>have done for us:
                        >>
                        >Oh, I'm sorry about that. I failed to get a copy of the CELKO SQL
                        >posting etiquette. Could you please point me in the right direction?
                        >Sarcasm aside, I will do this in the future. Thanks.
                        >
                        He's pretty much always like that. You get used to it after a while.
                        >
                        >>Why do you wish to destroy First Normal Form (1NF) with a concatenated
                        >>list structure? It is the foundation of RDBMS, after all. See why I
                        >>say you never read a book on RDBMS.
                        >>
                        >You're right I should have went out and bought a book on RDBMS. I mean
                        >who would ever think about asking a question on the internet was
                        >possible. I mean everybody should shut down all forums and rely on tech
                        >manuals because they are always so well written and contain every piece
                        >of knowledge on the planet about the subject, including all the hidden
                        >tips and tricks. Questions will be a thing of the past. Just grab a book
                        >and your answer will be there. Did you get criticized in class when you
                        >had a question about something? Did the teacher yell at you, tell you to
                        >read the book and never answer the question?
                        >
                        This is not a class. It's reasonable to expect people to do at least
                        a bit of reading on their own first.
                        >
                        >>Why did you think that an owner is an attribute of a dog? It is a
                        >>relationshi p! It might have attributes of its own, like license
                        >>numbers, issue date, etc. but let's ignore that.
                        >>
                        >I think a dog belongs to an owner. Can an owner have more than 1 dog?
                        >Hmmm.... I think so in this example. Yes, creating a seperate table in
                        >
                        But can a dog have more than one owner? If so, then the relationship
                        should indeed be moved into a third table.
                        >
                        This (among many other issues) is the sort of thing that questioners
                        tend to gloss over, not because they haven't thought about it, but
                        because the answer is obvious to them (whereas it is not obvious to
                        the rest of us). Politeness issues aside, I think it's a net gain
                        for such issues to be pointed out pre-emptively.

                        Comment

                        • Greg D. Moore \(Strider\)

                          #13
                          Re: SQL to combine columns

                          "yuri" <yuri32@hotmail .comwrote in message
                          news:l1jJh.36$a Q3.29@newsfe12. lga...
                          >
                          <Sarcasm>
                          Oh right, reading books!! Yes, I never thought of that. I should smack
                          myself over the head. Jeez... Let me pull some imaginary money out of my
                          butt, go to the store and grab the $40-$50 dollar book. (No library
                          reference please).
                          </Sarcasm>
                          In other words, you're part of the generation that thinks all the answers on
                          the Internet.

                          Sorry, but if you can't afford them, the library IS another option. The
                          Internet, as wonderful as it is, has its limitations.

                          >
                          I have found all the information on the internet, not from books or
                          schooling(SQL and RDBMS).
                          Unfortunately a lot of the information on the Internet sucks.

                          Did you or CELKO crawl out of the womb and say, "I am the Master at X, and
                          you will bow before me". I don't think so,
                          I think Joe Celko did. ;-)
                          therefore you must have done reading, schooling and for heaven sakes, you
                          ASKED questions from more experienced people at some point. Didn't you?
                          You have to start somewhere.
                          >
                          I guarantee I know something you or CELKO don't, and does it make it right
                          for me to criticize you if you ask a question that is very obvious to me?
                          No.
                          >
                          Yes, CELKO is a Master at RDBMS, I have just started out and have done
                          very well in only a few days. So, I cannot ask any questions until I
                          become extremely proficient at RDBMS and SQL! Huh... Tough group. ;)
                          >
                          Ok, that's over with. Now, let's drink to good times. ;)
                          >
                          Please, can you at least recommend a good book that is for intermediate to
                          advanced, in regards to SQL and RDBMS, recent copyright date please? I
                          will spare the money and buy it.
                          Actually Joe as a couple of decent books out there, not sure how many are
                          for true beginners.

                          He (and others) have posted some titles before, so google may find them.

                          I'd personally start finding a book on SQL theory itsellf. Unfortunately
                          cant' recommend any.

                          Though CJ Date has a decent book on the original work Codd did.
                          >
                          I think I accidently posted to: comp.databases. ms-sqlserver.maste rlevel.
                          ;)
                          >
                          --
                          Greg Moore
                          SQL Server DBA Consulting
                          Email: sql (at) greenms.com http://www.greenms.com


                          Comment

                          • yuri

                            #14
                            Re: SQL to combine columns

                            In other words, you're part of the generation that thinks all the answers
                            on the Internet.
                            OMG, heavens NO! I'm not that young. I wish I had this knowledge 20 years
                            ago. ;)

                            I do have an extensive library on programming, artificial intelligence,
                            expert systems, etc. Approaching, 30 books and the dump has more.
                            Unfortunately a lot of the information on the Internet sucks.
                            Hence, the question in the newsgroup.
                            Actually Joe as a couple of decent books out there, not sure how many are
                            for true beginners.
                            I don't need one for true beginners. I can get by. I need one for
                            intermediate to advanced. I hate the learn X in 21 days (Yea, right.)

                            I prefer more advanced books.

                            Comment

                            • Greg D. Moore \(Strider\)

                              #15
                              Re: SQL to combine columns

                              "yuri" <yuri32@hotmail .comwrote in message
                              news:CkjJh.37$a Q3.1@newsfe12.l ga...
                              >In other words, you're part of the generation that thinks all the answers
                              >on the Internet.
                              >
                              OMG, heavens NO! I'm not that young. I wish I had this knowledge 20
                              years ago. ;)
                              >
                              I do have an extensive library on programming, artificial intelligence,
                              expert systems, etc. Approaching, 30 books and the dump has more.
                              >
                              >Unfortunatel y a lot of the information on the Internet sucks.
                              >
                              Hence, the question in the newsgroup.
                              >
                              >Actually Joe as a couple of decent books out there, not sure how many are
                              >for true beginners.
                              >
                              I don't need one for true beginners. I can get by. I need one for
                              intermediate to advanced. I hate the learn X in 21 days (Yea, right.)
                              >
                              I prefer more advanced books.
                              In that case, honestly, Joe Celko's SQL for Smarties is a good. (which I
                              should pick up one of these days). ;-)

                              If you want SQL Server specific, anything by Itzk Ben-Gan on programming is
                              good.

                              I want to be like him when I grow up as a DBA :-)

                              (and Kalen Delaney too.. I'm reading her Inside SQL MSSQL 2005: The Storage
                              Engine now).

                              >
                              --
                              Greg Moore
                              SQL Server DBA Consulting
                              Email: sql (at) greenms.com http://www.greenms.com


                              Comment

                              Working...