Blog ala Vidar

SQL, AppFrame and other cool technologies

Monthly Archives: November 2010

SELECT TOP .. WITH TIES

Ever wanted to query a table and get all records that have one of the top 3 values? Let’s say you have a Sales-table where all your sales are stored. You want to find the top 3 sales, but you want to include “ties”. Let me show you with code.

DECLARE @Sales TABLE (
    Customer NVARCHAR(200),
    TotalSum FLOAT
)

INSERT INTO @Sales
  (Customer, TotalSum)
VALUES
  ('Statoil', 4000000),
  ('Hydro', 1000000),
  ('Kiwi', 100000),
  ('Mega', 100000),
  ('Ølen IL', 20)

SELECT TOP (3) WITH TIES
  *
    FROM @Sales
    ORDER BY TotalSum DESC

The results will be 4 rows:

Customer TotalSum
Statoil 4000000
Hydro 1000000
Kiwi 100000
Mega 100000

Pretty neat?

Advertisements

Use Hotmail with YOUR custom domain

Did you know you can use your custom domain in Hotmail, and with other Live services? A while ago, Microsoft “opened up” Hotmail to accept custom domains. You can do this by visiting http://domains.live.com . I’ve done this with my domain; nordnes.me. Now, http://mail.nordnes.me gets me to the hotmail login-form, where I log in with vidar@nordnes.me, and check my mail there. The great thing about this is that I no longer have to run my own exchange server, or worry about mail-things like spam or similar. Other interesting supported services are calendar, skydrives and photos. This makes it nicely integrated with my WP7.

Windows Phone 7 – HTC 7 Trophy

On Friday I finally got my WP7 (Windows Phone 7); HTC 7 Trophy. The reason I chose this device over the others was that this was the first I was able to get my hands on. The official words from Microsoft was that HTC Trophy, Mozart and LG’s E900 Optimus 7 were the only devices going to be released in the first “wave”. I’ve always thought of LG as the Lada of the electronics world. Have no idea why, just my impression. And, before you attack me on this, I have never owned a LG device, and never owned a Lada.

The difference between these devices isn’t much. 8MP instead of 5MP, 10 grams, 0.1” display etc. Trophy has a 0.1” bigger display than Mozart, and I don’t care about taking pictures, so easy choice.

Now, over to the best part; Windows Phone 7 is awesome! Let me first quote a mac-dude at the electronics shop I bought my device; “Whow! This is more like an Apple product than Apple ever has created”. I’m not sure I agree, but if he were talking about the user-friendliness, I have to agree. It’s sexy, simple and very quick. Before I got my device, iPhone was, without a doubt, the best phone I’ve ever had. I want to wait a couple of days before I change this, but till now my impression can be summarized with one word. awesome!

When setting my phone I added a live ID with US address, just to get access to the Marketplace. To buy anything I need an American visa-card or similar, but till now there’s only one app I want to buy and that is Geocaching. It’s a bit annoying that they haven’t opened for this in Norway yet, but to be fair, I did know this before I bought the phone.

Other than the obvious (things not available yet, English keyboard etc.), there’s only two things I don’t like about this phone. First, the micro-USB connector is on the left side, and the mini-jack is on the top. I listen to podcasts when ever I’m in my car, and that’s at least 1.5 hours each day. Because I don’t want to drive with plugs in my ears I use a FM-transmitter connected to the mini-jack, and of course charging with the micro-USB. Here’s the problem. It’s impossible to place the device with these two cables in it, and still be able to unplug the cables if anyone calls, and take the call before they hang up.

The other thing that’s starting to annoy me is a bit harder to explain. There’s a great feature built into the People Hub (basically where all your contacts live) where you can link accounts. Example; I’m friend with Jan Leon (a co-worker) on Facebook. I’ve also got him as a contact in Outlook (via Exchange), on my Gmail account, and on two of my Live IDs. With the link stuff, I link these accounts together, so I’ve only got one “Jan Leon” in my contact list on my phone. This is great, but here’s the problem. When linking these, it seems to make the shortest a default. This wouldn’t be a problem if I had added FirstName LastName etc. for all my contacts in all my accounts, but since I’m lazy, janleon@omega.no is the shortest. This means I have to go into this and rename my contact, although 4 of 5 contacts in the linked list is called “Jan Leon Sandslett”. This is really annoying, since I’ve got 300 friends on Facebook, 200 contacts in Outlook and about 250 contacts on MSN which mostly is the same people.

But what about copy-paste? Think it over. When did you last use it on your phone? When you get a phone-number on SMS, you just click it and create a contact (or similar). If you want to share an URL on Facebook, you just click the share button. I think I’ve used copy-paste once while I’ve had my iPhone, and that’s about a year. But, for those that can’t live without it, for some weird reason, you only have to wait till Microsoft releases an update in January 2011. Multitasking is also coming. I can see why people want this, but I didn’t use it on iPhone, and can’t see when I’d use it on the WP7. For the record, WP7 has multitasking, but only for the internal applications. This means you can listen to music in Zune while doing other stuff.

Final words. If you’re a technology enthusiast, there’s no other choice. You have to buy a Windows Phone 7. If you’re a normal user, like my mom, you want to wait till (hopefully) Q1 2011. I hope Microsoft’s opened Zune Pass, Marketplace and the other good stuff by then.