Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 4th, 2008, 04:08 AM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to Distinct two colums but select other colums

Hi all,

I have a table,

Station------Lat------Lon

Sta1_________10.1_____10.2
Sta__________10.1_____10.2
Sta2_________15.5_____15.5

I am trying to distinct the table with Lat and Lon values. And select ONE OF the Station values.

So final query result must be;

Station------Lat------Lon

Sta1_________10.1_____10.2
Sta2_________15.5_____15.5





Could you please help me?


Reply With Quote
  #2 (permalink)  
Old April 4th, 2008, 07:53 AM
Authorized User
 
Join Date: Jun 2003
Location: Colombo 04, WP, Sri Lanka.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Preethi Send a message via Yahoo to Preethi
Default

Try this:
SELECT MIN(Station) Station, Lat, Lon
FROM <Table name>
GROUP BY Lat, Lon


G.R.Preethiviraj Kulasingham
Reply With Quote
  #3 (permalink)  
Old April 5th, 2008, 06:08 AM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
onlick display more colums mateenmohd Classic ASP Basics 5 July 28th, 2007 07:12 AM
Displaying items in Colums in roes azambee Access 4 January 5th, 2007 04:57 AM
Dynamically adding Colums to datagrid ? vivekshah C# 0 April 15th, 2006 02:54 AM
group extra colums jun99 PHP How-To 0 December 5th, 2005 02:43 PM
Sorting on mulitple colums Greg Griffiths Javascript 0 June 20th, 2003 12:07 PM



All times are GMT -4. The time now is 09:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.