Re: SQL comments

From: Tom Allison <tallison(at)tacocat(dot)net>
To: Jaime Casanova <systemguards(at)gmail(dot)com>
Cc: Shoaib Mir <shoaibmir(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: SQL comments
Date: 2006-06-12 10:25:41
Message-ID: 448D4125.2020801@tacocat.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Jaime Casanova wrote:
>> Found them, eventually.
>> I was trying to insert a comment in the middle of a line:
>>
>> select status, reason, --method
>> from....
>>
>
> Actually, you can put a comment in the middle of a line. Your mistake
> in the above statement is because of the comma before the command, the
> parser sees this:
>
> select status, reason, from ....
>
> it's completely legal to write:
> select status, reason --method
> from mytable -- line 2
>

OMG!!! I sit and write SQL ~6 hours a day at work on Oracle.
There's something wrong with my brain.
Writing SQL on postgresql isn't so strange that I should be making such simple
mistakes.

I do have to figure out all the date/time formats/functions, but that's just a
learning curve. Aggregate goodies are a trick as well. I've been picking up
some Oracle specific keywords and it's now taking it's toll.

Thank you for putting up with my ignorance. I can't promise it won't happen
again, but I think I realize just how careful I have to be on my learning curve.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2006-06-12 12:23:48 Re: Question about stored procedures
Previous Message Tom Allison 2006-06-12 10:17:41 Re: uh-oh