Re: [SQL] ERROR: malformed record literal: "",DETAIL: Missing left parenthesis?

2011-07-06 Thread Adrian Klaver
On 07/06/2011 12:03 PM, Emi Lu wrote: A question about: ERROR: malformed record literal: "" DETAIL: Missing left parenthesis. Can someone tell me what cause the error? Table z_drop; Column | Type -+ run_date | character varying(128)

Re: [SQL] ERROR: malformed record literal: "",DETAIL: Missing left parenthesis?

2011-07-06 Thread Emi Lu
A question about: ERROR: malformed record literal: "" DETAIL: Missing left parenthesis. Can someone tell me what cause the error? Table z_drop; Column | Type -+ run_date | character varying(128) adm_year | character varying(4) adm_se

[SQL] ERROR: malformed record literal: "",DETAIL: Missing left parenthesis?

2011-07-06 Thread Emi Lu
Good morning, A question about: ERROR: malformed record literal: "" DETAIL: Missing left parenthesis. Can someone tell me what cause the error? Table z_drop; Column| Type -+ run_date| character varying(128) adm

Re: [SQL] interesting sequence

2011-07-06 Thread Gavin Flower
On 06/07/11 01:52, John Fabiani wrote: Hi, I have a special need to create a sequence like function. "O-20110704 -2" which is "O" for order (there are other types) "20110704" is for July 4, 2011 '2' the second order of the day for July 4, 2011 I of course can get the type and date. What I do

Re: [SQL] interesting sequence

2011-07-06 Thread Jasen Betts
On 2011-07-06, Kevin Crain wrote: > That's why you need to do this inside a function. Basically just make > an insert function for the table and have it calculate the count and > do the insert in one transaction. you will still get duplicates, so include code in the function to retry if there is

Re: [SQL] group by with sum and sum till max date

2011-07-06 Thread Samuel Gendler
On Tue, Jul 5, 2011 at 10:42 AM, M. D. wrote: > This is a little hard to explain, and I'm not sure if it's possible, but > here goes. > > This is my query: > select year, month, > (select number from account where account.account_id = > view_account_change.account_**id) as number, > (select name