How I write pretty query - Mailing list pgsql-sql

From Rado Petrik
Subject How I write pretty query
Date
Msg-id 1051638365.775.95.camel@caj
Whole thread Raw
Responses Re: How I write pretty query  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql

Hi , 


I have table 

------------------
id     |  name 
------------------
1         rado 
2         marek
3         pista 

I need make query. Your output is only (true or false) 

This 2 query are good but no pretty.

1)      SELECT COUNT(*) FROM table WHERE name=rado 
                       -------------       output    -->   COUNT(*)   1 

or 

2)      SELECT name FROM table WERE name=rado        
                       -------------       output    -->   name   rado 





and this is pretty query :-) buy no good.
       SELECT (true or false) FROM table WHERE name=rado
                       --------------       output ---->        true 

How I write good and pretty query ? 

Thanks 

Rado 



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PERFORM] Query Plan far worse in 7.3.2 than 7.2.1
Next
From: Stephan Szabo
Date:
Subject: Re: How I write pretty query