Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004

    error having muultiple values in one database field

    I have a query I am just starting...but have already run into a problem

    Select 'test, ' as module,
    (Select title + ' '
    From test_documents) as text_text
    From test_table

    So there are multiple rows in the test_document table and I want ALL of those to be in test_text.

    So...I want test_text to look like:

    title1 title2 title3

    I am using it as text to be indexed and searched.

    Thanks sooo much for any ideas!!!

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    I'm not sure that I understand what you're asking. If you are trying to create a table with multiple values in a single column, that is a really, REALLY bad thing to do! If you are trying to create a cross-tab query that builds a list of the values in some column for all of the rows that meet some condition, that is better done on the client, although it can be done in the database too.

    Can you give us a better "real world" description of what you are trying to do, that will probably help more than anything.


  3. #3
    Join Date
    Jun 2004
    I basically am trying to make a View...that I will use for searching....

    those titles : title1 title2 title3

    would be in one column named search_text

    that will be indexed by my search...

    I know that when I run my scheduled file to index I could do some code there to combine all the fields....just wanted the smalles amount of processing time as indexing takes long enough.

    so basically if the user searches any of those title would bring up one result ...

  4. #4
    Join Date
    Jun 2004
    declare @string varchar(1000)

    select @string = ''

    select @string = rtrim(@string) + [Your_Column] + ','

    from [Your_Table]

    select substring( @string, 1, len(@string) - 1)

    This works.....then I can just can do another select with my other fields and it works great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts