can someone explain confusing array indexing nomenclature - Mailing list pgsql-sql

From chrisj
Subject can someone explain confusing array indexing nomenclature
Date
Msg-id 8971770.post@talk.nabble.com
Whole thread Raw
Responses Re: can someone explain confusing array indexing nomenclature
List pgsql-sql
given the following table:

protocal2=> select * from sal_emp ;name  |      pay_by_quarter       |                 schedule
-------+---------------------------+-------------------------------------------Bill  | {10000,10000,10000,10000} |
{{meeting,lunch},{training,presentation}}Carol | {20000,25000,25000,25000} |
{{breakfast,consulting},{meeting,lunch}}
(2 rows)

why do the following two queries yield different results??

protocal2=> SELECT schedule[1][2] FROM sal_emp WHERE name = 'Bill';schedule
----------lunch
(1 row)

protocal2=> SELECT schedule[1:1][2] FROM sal_emp WHERE name = 'Bill';    schedule
-------------------{{meeting,lunch}}
(1 row)

-- 
View this message in context:
http://www.nabble.com/can-someone-explain-confusing-array-indexing-nomenclature-tf3229165.html#a8971770
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



pgsql-sql by date:

Previous
From: "sahaanaa subha"
Date:
Subject: Regaring posting a query
Next
From: "Edward W. Rouse"
Date:
Subject: problem with join