Thursday, November 5, 2009

How to SELECT DISTINCT multiple columns in postgreSQL?

This is helpful when you wanted to get multiple columns and also needed a column to be distinct

table columns
id
firstname
middlename
address
age
gender


here is the query....


SELECT 
DISTINCT 
ON(firstname)firstname, 
lastname, 
middlename,
address,
age,
gender;


hope that little code helps. : )

2 comments:

Feeds

Sonic Run: Internet Search Engine javascript, coldfusion, programming, simple programming teckniques, css, html Webfeed (RSS/ATOM/RDF) submitted to http://www.feeds4all.nl Web Development & Design Blogs DigNow.net

Search Engine Optimization and SEO Tools
javascript, coldfusion, programming, simple programming teckniques, css, html