pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yasir Malik <ymalik@cs.stevens.edu>
To: PostgreSQL <pgsql-sql@postgresql.org>
Subject: Re: Am I crazy or is this SQL not possible
Date: Thu, 1 Jun 2006 15:47:57 -0400 (EDT)
Message-ID: <Pine.NEB.4.64.0606011540570.1881@pink-elephant.cs.stevens-tech.edu> (raw)
In-Reply-To: <bf05e51c0606011230n3abf90e3h81781e0ab0451693@mail.gmail.com>
References: <df01c91b0606011043g61328d6habaee8fa037a5ccf@mail.gmail.com>
	<Pine.NEB.4.64.0606011409360.758@pink-elephant.cs.stevens-tech.edu>
	<447F34B1.5020004@oisinglynn.com>
	<Pine.NEB.4.64.0606011450520.855@pink-elephant.cs.stevens-tech.edu>
	<bf05e51c0606011230n3abf90e3h81781e0ab0451693@mail.gmail.com>

> It is a hack, but when someone wants you to do something in a way
> different from the norm, aren't they asking for a hack?
>
> SQL Server does something like
> select top (1) from ....
>
> I am thinking this is NOT a SQL-99 standard.
>
This was an interview with Amazon, and I don't think Amazon wanted a hack. 
I hope Amazon doesn't use hacks.  There has to be another way.  It would 
be cruel if they expected me know some database specific functionality.
Here's what I gave them:
select value
   from table t
  where t.value >
   (select t2.value
      from table t2);

which would be fine if the sub-select returned simply a list, but that 
isn't even valid SQL (I didn't get the job, BTW).

Yasir



view thread (20+ messages)  latest in thread

Message-ID: <Pine.NEB.4.64.0606011540570.1881@pink-elephant.cs.stevens-tech.edu>
Permalink:  ../Pine.NEB.4.64.0606011540570.1881@pink-elephant.cs.stevens-tech.edu/
Also on:    postgresql.org/message-id/Pine.NEB.4.64.0606011540570.1881@pink-elephant.cs.stevens-tech.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: ymalik@cs.stevens.edu
  Subject: Re: Am I crazy or is this SQL not possible
  In-Reply-To: <Pine.NEB.4.64.0606011540570.1881@pink-elephant.cs.stevens-tech.edu>
  References: <df01c91b0606011043g61328d6habaee8fa037a5ccf@mail.gmail.com> <Pine.NEB.4.64.0606011409360.758@pink-elephant.cs.stevens-tech.edu> <447F34B1.5020004@oisinglynn.com> <Pine.NEB.4.64.0606011450520.855@pink-elephant.cs.stevens-tech.edu> <bf05e51c0606011230n3abf90e3h81781e0ab0451693@mail.gmail.com> <Pine.NEB.4.64.0606011540570.1881@pink-elephant.cs.stevens-tech.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox