Re: [SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-23 Thread Thomas F.O'Connell
How would one know from the reference material that it is possible to include IS NOT NULL in an ORDER BY clause? Similarly, other than the FAQ, I've never been able to tell from the SELECT documentation why ORDER BY random() works. -tfo -- Thomas F. O'Connell Co-Founder, Information Architect S

Re: [SQL] Comparing Dates

2004-11-18 Thread Thomas F.O'Connell
Ha. Why so it is. :) -tfo -- Thomas F. O'Connell Co-Founder, Information Architect Sitening, LLC http://www.sitening.com/ 110 30th Avenue North, Suite 6 Nashville, TN 37203-6320 615-260-0005 On Nov 18, 2004, at 11:50 PM, Greg Stark wrote: "Thomas F.O'Connell" <[EMAIL PRO

Re: [SQL] Comparing Dates

2004-11-18 Thread Thomas F.O'Connell
Nick, You need to quote your date constant value: '2004-06-08' select '2004-06-08'::date > 2004-06-08; ?column? -- t (1 row) select 2004-06-08; ?column? -- 1990 I'm not exactly sure how the bare string is converted internally, but it's clearly not a complete date like you'r

Re: [SQL] Counting Distinct Records

2004-11-16 Thread Thomas F.O'Connell
r the tips so far! -tfo -- Thomas F. O'Connell Co-Founder, Information Architect Sitening, LLC http://www.sitening.com/ 110 30th Avenue North, Suite 6 Nashville, TN 37203-6320 615-260-0005 On Nov 16, 2004, at 4:34 PM, Stephan Szabo wrote: On Tue, 16 Nov 2004, Thomas F.O'Connell wrote: Is

Re: [SQL] Counting Distinct Records

2004-11-16 Thread Thomas F.O'Connell
ww.sitening.com/ 110 30th Avenue North, Suite 6 Nashville, TN 37203-6320 615-260-0005 On Nov 16, 2004, at 2:03 PM, Stephan Szabo wrote: On Tue, 16 Nov 2004, Thomas F.O'Connell wrote: I am wondering whether the following two forms of SELECT statements are logically equivalent: SELECT COU

Re: [SQL] Help in stored procedure

2004-11-05 Thread Thomas F.O'Connell
I think you want to be using SELECT INTO rather than assignment for your queries. See http://www.postgresql.org/docs/7.4/static/plpgsql- statements.html#PLPGSQL-STATEMENTS-ASSIGNMENT http://www.postgresql.org/docs/7.4/static/plpgsql- statements.html#PLPGSQL-SELECT-INTO The expression part of

Re: [SQL] help with to_date and to_char

2004-10-19 Thread Thomas F.O'Connell
6 Nashville, TN 37203-6320 615-260-0005 On Oct 19, 2004, at 6:00 PM, Edmund Bacon wrote: Thomas F.O'Connell wrote: There might be a better way, but this should do what you want. And I think that you can safely replace '05' with when_month. select to_char( to_date( '05' ||

Re: [SQL] help with to_date and to_char

2004-10-19 Thread Thomas F.O'Connell
There might be a better way, but this should do what you want. And I think that you can safely replace '05' with when_month. select to_char( to_date( '05' || '/' || to_char( current_date, 'DD/' ), 'MM/DD/' ), 'MON' ); -tfo -- Thomas F. O'Connell Co-Founder, Information Architect Sitenin