Problem with view
От | Wenjin Zheng |
---|---|
Тема | Problem with view |
Дата | |
Msg-id | E3E65B3C4E12D311BE6900A0C9EC2FA11554C9@GENOMICS1 обсуждение исходный текст |
Ответы |
Re: Problem with view
|
Список | pgsql-hackers |
Hi, I have got another problem. I have a table(table tempOne) that has two fields, seqid(int) and phredscore(int). They are one to many relationship, e.g. one seqid has many phredscore. I would like to get the row that has the max(phredscore). So I first created a view as follow: "create view maxphred as select seqid, max(phredscore) as phredscore from tempOne group by seqid;" Then I try to get the rows that corresponding to the top phredscore. I did this: "select tempOne.* from tempOne, maxphred where tempOne.seqid=maxphred.seqid and tempOne.phredscore=maxphred.phredscore;" I got some weird stuff back which obviously is wrong. However if I create a table maxphred rather than a view, I get the correct result. There might be something missing for the view that I did not know of. Does anyone know that my query with view did not work. Your help will be greatly appreciated. Wenjin Zheng Bioinformatic Analyst Biosource Technologies, Inc. 3333 Vaca Valley Parkway Vacaville, CA 95688 (707)469-2353 email: wenjin.zheng@lsbc.com
В списке pgsql-hackers по дате отправления: