Exotic SQL Question

May 11, 2006

Table 1:
id1 name
10 - Monday
20 - Tuesday
30 - Wed..
40 - etc

Table2:
id2 - name
5 - blue
25 - red
33 - yellow
77- gree

How do I use SQL to join the tables so that the "id1" columns join on
the largest "id2" value smaller than "id1"

Result:
Monday - blue
Tuesday - blue
Wed - red
etc

Thanks
JFO

View 8 Replies


ADVERTISEMENT

Exotic Unpivot Transformation

Jul 18, 2006

I totally give up.

I need to import an csv file with system monitor performance counters into a sql server 2005 database

example csv format:

"(PDH-CSV 4.0) (W. Europe Daylight Time)(-120)","Server1Memory\% Commited Bytes In Use", )","Server2Memory\%Commited Bytes In Use"
"07/18/2006 10:08:57.295","24.701095057336488","30.701095077776488"

and I want it to transform it into:

Time ServerName Memory\% Commited Bytes In Use
07/18/2006 10:08:57.295 Server1 24.701095057336488
07/18/2006 10:08:57.295 Server2 30.701095077776488

I have two problems:

I need to trim the servername from the column values
I need to insert an extra column ServerName and put those server names in it

I tried Unpivot and Fuzzy grouping in SSIS but it's al too fuzzy for me...

Any pointers someone?
Many thanks!

Regards,

Mop

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved