Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 6913F63246B for ; Fri, 10 Jul 2009 04:23:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 64143-04-5 for ; Fri, 10 Jul 2009 04:23:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f223.google.com (mail-ew0-f223.google.com [209.85.219.223]) by mail.postgresql.org (Postfix) with ESMTP id D409E6339F3 for ; Fri, 10 Jul 2009 04:23:12 -0300 (ADT) Received: by ewy23 with SMTP id 23so735129ewy.19 for ; Fri, 10 Jul 2009 00:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=nmXqgrBxlE/ItdGIiemPJdsrIq+nrho0d5890fov44A=; b=vZvQijQdBqcffMM+R9NRwI09UKPdfREBXabdS1DgMj9ORCI0egYPCBTgyTmdpXGyH/ riWmTaoY+Q4xWmVrSK59hWkw217XIi+opMtWplYsZTmyb0GkkdZ2RloB12/n2OwQ3J8j Fe0Zj5Kt2Xv7UTdaMthoERp1Gh+CCyhzOyDR8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=SCnP+7yjyQei4A80bHAmG484pdc1JGtDhdan6XYDI4vcDAO0b3m8F5gl7DdEiE39NE EWqOZU08Iywi6E++isdGP7HWwEjnFtP8W4uC6NpWL8gO1RHCfJya5yGwaBdGly5Z8yvW ajxjyR9DrJ1eJWduZaVv4nr94DRyGrqmLL1aA= MIME-Version: 1.0 Received: by 10.210.116.14 with SMTP id o14mr2000225ebc.97.1247210591111; Fri, 10 Jul 2009 00:23:11 -0700 (PDT) From: Marcin Krawczyk Date: Fri, 10 Jul 2009 09:22:51 +0200 Message-ID: <95f6bf9b0907100022u41173cl2ef880a3952d3996@mail.gmail.com> Subject: skip if latter value equal To: pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=0015174c136e3e49b9046e54d853 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200907/50 X-Sequence-Number: 32791 --0015174c136e3e49b9046e54d853 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi list, I was wondering if it was possible for a field in SQL query to return NULL if latter value is exactly the same ? - for given ORDER BY clause, I guess. For example, query returns: xxyy 1 4 true xxyy 5 7 true xxyy 21 8 true yyzz 5 1 false yyzz 7 7 false yyzz 8 34 false I'd like the output to be: xxyy 1 4 true NULL 5 7 NULL NULL 21 8 NULL yyzz 5 1 false NULL 7 7 NULL NULL 8 34 NULL Is there any magical trick to achieve this ? regards mk --0015174c136e3e49b9046e54d853 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi list,

I was wondering if it was possible for a field in SQL query= to return NULL if latter value is exactly the same ? - for given ORDER BY = clause, I guess.
For example, query returns:

xxyy=A0 1=A0 4=A0 tr= ue
xxyy=A0 5=A0 7=A0 true
xxyy=A0 21=A0 8=A0 true
yyzz=A0 5=A0 1 falseyyzz=A0 7=A0 7 false
yyzz=A0 8=A0 34 false

I'd like the out= put to be:

xxyy=A0 1=A0 4=A0 true
NULL=A0 5=A0 7=A0 NULL
NULL=A0 21=A0 8=A0 NULL
yyzz=A0 5=A0 1 false
NULL=A0 7=A0 7 NULL
NULL=A0 8=A0 34 NULL

= Is there any magical trick to achieve this ?

regardsmk
--0015174c136e3e49b9046e54d853--