Skip site navigation (1) Skip section navigation (2)

Re: Different type of query

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: PostgreSQL Admin <postgres(at)productivitymedia(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Different type of query
Date: 2008-06-11 18:27:36
Message-ID: 48501918.4030803@pinpointresearch.com (view raw or flat)
Thread:
Lists: pgsql-sql
PostgreSQL Admin wrote:
> I have a table ...
>
> when I run this query:
> select ndb_no, nutrient_no, nutrient_value from nutrient_data where 
> ndb_no = 13473;
>
> it produces:
> ndb_no | nutrient_no | nutrient_value
> --------+-------------+----------------
>  13473 |         203 |          24.18
> ...
>
>
> I want only certain nutrient_no (say 8 of them) and the nutrient 
> values by ndb_no.
Not entirely sure I understand the question. Do you mean that for a 
given nutrient_no, you want the complete list of nutrient values? If so, 
it's just:

--Example for nutrient_no 203:
SELECT ndb_no, nutrient_value from nutrient_data where nutrient_no=203;

Cheers,
Steve


In response to

Responses

pgsql-sql by date

Next:From: PostgreSQL AdminDate: 2008-06-11 18:41:48
Subject: Re: Different type of query
Previous:From: PostgreSQL AdminDate: 2008-06-11 17:27:45
Subject: Different type of query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group