Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2009
    Posts
    1

    Unanswered: select for update

    Why this doesn't work?

    select * from certificati where cert_anno=2007 and cert_progressivo is null for update order by data_rif asc;

    It's gives me this error:

    ERROR: syntax error at or near "order"
    LINE 1: ..._anno=2007 and cert_progressivo is null for update order by

    Can you help me plese.

    Thanks

  2. #2
    Join Date
    Feb 2009
    Posts
    6

    try this

    select * from certificati where cert_anno=2007 and cert_progressivo='"null"' for update order by data_rif;

    no need to give asc.
    it will order only by acs by default..

    if u need descending means u give desc..

    i dont know whether working or not but just my suggestion bcoz am also new to poslgresql

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    ref PostgreSQL: Documentation: Manuals: PostgreSQL 8.3: SELECT

    For Update comes LAST...

    Code:
    select * 
    from certificati 
    where cert_anno=2007 and cert_progressivo is null 
    order by data_rif asc
    for update
    jeyasree: Is Null is valid syntax. If nothing was entered into the field, the value is null (unknown)

    Also, while the ASC argument is the default order direction, it doesn't cause an error to be thrown if you use it.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  4. #4
    Join Date
    Feb 2009
    Posts
    6

    thanks

    Thank you for valuable information

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •