Results 1 to 4 of 4

Thread: Can SQL do this?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    79

    Can SQL do this?

    Hi all.

    I have 2 tables in Access (see attachments).
    1) InvertedFile
    2) TermSet

    From these 2 tables, I want to make a new db table called InverseDF (see attachment).

    Table of InverseDF consists of fields: Terms which is retrieved from TermSet.Terms and another fields that I want it to be retrived from the DocNo (SELECT InvertedFile.DocNo FROM InvertedFile GROUP BY DocNo) which the result would be like in the attachment (InverseDF.jpeg).

    The records for field 96 and 97 are retrieved from table InvertedFile. And, the record will be set to "0" if the term does not belong to the DocNo(96 or 97).

    For the Terms field, this is easy for me to do.
    conn.Execute "SELECT TermSet.Terms INTO InverseDF FROM TermSet;"

    But for other fields, I think this is difficult for me to do.
    I just wonder, is this possible in SQL to make rows become the columns of table? If possible, how to construct the SQL?
    If this is not possible, can anyone give me an idea or another possible way to do this?

    Pls help, thanks in advance.
    Attached Images Attached Images    
    Last edited by Rina; Aug 27th, 2005 at 01:38 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width