This is a discussion on Case with Char(1) within the pgsql Sql forums, part of the PostgreSQL category; --> Hi list, it is possible to use case with character (1) ? I am having problems to formate the ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi list, it is possible to use case with character (1) ? I am having problems to formate the SQL statement. I have: SELECT * FROM test; a --- A B C SELECT a, CASE WHEN a='A' THEN 'one' WHEN a='B' THEN 'two' ELSE 'other' END FROM test; a | case ---+------- A | one B | two C | other I know from all program languages that case do not apply to noun sequencialiable (if this word exists) variable (like integers etc). Any help would be greatfull. Thanks in advance Ezequias ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| |||
| On Wed, Feb 28, 2007 at 10:02:38AM -0300, Ezequias Rodrigues da Rocha wrote: > Hi list, > > it is possible to use case with character (1) ? > > I am having problems to formate the SQL statement. Your example looked like it worked. A -- Andrew Sullivan | ajs@crankycanuck.ca Users never remark, "Wow, this software may be buggy and hard to use, but at least there is a lot of code underneath." --Damien Katz ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |
| |||
| Am Mittwoch, 28. Februar 2007 14:02 schrieb Ezequias Rodrigues da Rocha: > it is possible to use case with character (1) ? Have you tried it? -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL project by donating at http://www.postgresql.org/about/donate |
| ||||
| Now it is working. Thank you for your interest. Ezequias 2007/2/28, Andrew Sullivan <ajs@crankycanuck.ca>: > On Wed, Feb 28, 2007 at 10:02:38AM -0300, Ezequias Rodrigues da Rocha wrote: > > Hi list, > > > > it is possible to use case with character (1) ? > > > > I am having problems to formate the SQL statement. > > Your example looked like it worked. > > A > > -- > Andrew Sullivan | ajs@crankycanuck.ca > Users never remark, "Wow, this software may be buggy and hard > to use, but at least there is a lot of code underneath." > --Damien Katz > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A pior das democracias ainda é melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |