Re: [GENERAL] Sort problem
От | Samuel J. Sutjiono |
---|---|
Тема | Re: [GENERAL] Sort problem |
Дата | |
Msg-id | 01d001c1be30$5d0a5370$110a010a@headquarters.wcgroup.com обсуждение исходный текст |
Ответ на | Sort problem ("Samuel J. Sutjiono" <ssutjiono@wc-group.com>) |
Список | pgsql-sql |
Fernando, My apology. Actually I posted the wrong problem. Here is my problem: IF (SortOrder = ''price'') Then BEGINFor rec_set IN SELECT * from Catalog where ((VendorName ~* SearchString) ORDER BY CASE WHEN SortOrder = ''store''Then VendorName WHEN SortOrder = ''category'' Then ProductCategory Else Price END Here is the error message: ERROR: CASE types "numeric" and "varchar" not matched. By the way, do you know how to do a variable (that contains 'attribute name' instead of 'attribute value') substitution. For instance, if the attribute name 'Price' is passed to the sort parameter ($1) so I can just do ORDER BY $1 instead of doing case statement. Thanks so much for your help. ----- Original Message ----- From: "Fernando Schapachnik" <fschapachnik@vianetworks.com.ar> To: "Samuel J. Sutjiono" <ssutjiono@wc-group.com> Sent: Monday, February 25, 2002 1:59 PM Subject: Re: [GENERAL] Sort problem > Maybe someone can help you if you post your query and the error > message. Is like going to the doctor: you don't has claim: "it > hurts". > > Good luck > > En un mensaje anterior, Samuel J. Sutjiono escribió: > > I was trying to do the following sort (two attributes with different types), but I kept on getting errors. > > > > ORDER BY Price (data type - decimal), ProductName (data type - varchar) > > > > Thanks for any help. > > > > > > > > Fernando P. Schapachnik > Gerente de tecnología de red > y sistemas de información > VIA NET.WORKS ARGENTINA S.A. > fschapachnik@vianetworks.com.ar > Tel.: (54-11) 4323-3381 >
В списке pgsql-sql по дате отправления: