Re: consolidating recordsinto a new table

From: Louis Davidson (dr_dontspamme_sql_at_hotmail.com)
Date: 12/07/04


Date: Mon, 6 Dec 2004 23:21:05 -0600

I don't see anything to join with, can you explain your datasets a little
more?

-- 
----------------------------------------------------------------------------
Louis Davidson - drsql@hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design - 
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in 
consulting services.  All other replies may be ignored :)
"munch" <munch@discussions.microsoft.com> wrote in message 
news:BED8EA17-0073-42B9-8DFB-26FB491BB483@microsoft.com...
> Here is some sample data from Table A
>
> KY     ID  INITIAL   NAME  SEX   HIREDATE  STRTDATE   STA ACT  REA 
> ENDDATE
> 100   45 AA        SMITH   M    19680513 19680513           20030115
> 101   45 AA        SMITH   M    19680513 20030115     A           20040328
> 102   45 AA        SMITH   M    19680513 20040328      P   PLA MED 
> 20040516
> 103   45 AA        SMITH   M    19680513 20040620     A
>
>
> HERE IS SOME SAMPLE DATA FROM TABLE B
> KY     FULLDATE   YEAR   MONTH   DAY
> 1      20030115    2003     01          15
> 2      20040328    2004     03          28
> 3      20040620    2004     06          20
> 4      20040915    2004     09          15
> 5      20041017    2004     10          17
> 6      19680513    1968     05          13
>
> HERE IS SOME SAMPLE DATA FROM TABLE C
> KY     RANK_CD
> 0      LEVEL0
> 1      LEVEL1
> 2      LEVEL2
> 3      LEVEL3
> 4      LEVEL4
> 5      LEVEL5
>
> IN TABLE D, I AM TRYING TO GET THE DATA TO LIKE THE FOLLOWING:
> TABLE A.KY      TABLE B.KY       TABLE C.KY      POSN_NO
> 100                   6                       1                   1234
> 101                   1                       1                   1234
> 102                   2                       2                   1234
> 103                   3                       3                   1234
>
> THANKS 


Relevant Pages

  • Re: Query for search engine
    ... > relational database and is not restricted to SQL server. ... > our internet site and SQL for our intranet sites. ... >> Could you please post some DDL, sample data and expected result? ...
    (microsoft.public.sqlserver.programming)
  • Access SUMs Full Column When Using Subquery
    ... I jumped over to SQL Server, and it gave me the results I wanted, so ... Sample Data: Students_02272005_1 ... SELECT clause due to conditions specified on the subquery's WHERE ... Stud_ID Lesson PercentAbove5 ...
    (microsoft.public.access.queries)
  • Re: join on 3 tables for asp output
    ... The table structure and sample data is ... >> Mondays since I am scheduling instruments for a whole week. ... > some outer joins (I'm assuming this is SQL Server, ... > quicker response by posting to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: how to conver nvarchar with value like(12.23) to time (12:23)
    ... Can you please give us a script of some sample data to try out? ... Pro SQL Server 2000 Database Design - ... > "Arithmetic overflow error converting expression to data type datetime" ... > INSERT INTO TourItemsTemp (FromTime, ToTime, TimeCodeID, ...
    (microsoft.public.sqlserver.programming)
  • Re: Need help with hint syntax in SQL Server 2000
    ... unable to recognize that it shoul push the where clause condition down ... Some sample data might help as well, ... My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis ...
    (comp.databases.ms-sqlserver)