Em Andamento

Postgresql function/stored procedure

I have a database which has a table containing articles that appear in a magazine. Each article appears on one of more pages of the magazine. In the database page numbers are stored in a character varying (VARCHAR) field with values such as 1, 2, 3, 4, 5, etc. But also with values such as OBC (outside back cover), IFC (inside front cover).

I need to pull the articles out of the database order by page number but am having trouble achieving this with standard SQL and postgres. I think I need a custom written function/stored procedure to sort the results for me.

My ideal sort would be need to be specified, but at the very least it should sort like this:

OFC

IFC

1

2

3

..

9

10

11

12

..

21

22

..

IBC

OBC

This is a numeric sort i suppose but on a varchar field with named pages also.

Can anyone help?

Thanks

Mario

Habilidades:

Ver mais: postgres procedure, postgresql function procedure, postgres function call web service, postgresql functions procedures, store procedure postgres, postgresql function, postgreql function inside procedure, postgre functions stored procedure, sort function c, outside magazine, numbers function, number function, function of numbers, function numbers, function number, c sort function, function procedure postgresql, stored procedure postgresql view, procedure postgre, postgre functions sort, postgre standard procedure, postgresql automatic function maker, store procedure postgresql, unitils postgres, functions stored procedures postgres

Acerca do Empregador:
( 4 comentários ) Leeds, United Kingdom

ID do Projeto: #138433

Premiar a:

reflection

Hello. I can solve this issue immediately either as a plpgsql function or standard sql statement. Please send me info about the database structure and your PostgreSQL version, since based on that info it may be possib Mais

$30 USD em 0 dias
(12 Avaliações)
2.0

3 freelancers estão ofertando em média $30 para este trabalho

belarusoft

Ok, Mario. This is very simple problem. Wait for your message

$30 USD in 2 dias
(0 Comentários)
0.0
vpalii

Please try solution from PM. Best regards, vpalii.

$30 USD in 0 dias
(1 Comentário)
0.0