Re: [SQL] Query question

2012-01-28 Thread Lew
ed. I'm going to guess that it's because you didn't use a separate alias for the FROM in the correlated subquery. Doesn't STRPOS() return INTEGER, not TEXT? -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg -- Sent via pgsql-sql mail

Re: [SQL] extracting location info from string

2011-05-25 Thread Lew
Tarlika Elisabeth Schmitz wrote: Lew wrote: That isn't a table structure, that's a freeform text structure. You didn't state your question, Tarlika, but your database structure is terrible. For example, "region" and "country" should be different columns.

Re: [SQL] extracting location info from string

2011-05-23 Thread Lew
meanings in different areas - it can mean part of a county, or state / province, or nation, or continent. "The Baltic region", "the Northeast", "upstate", "the North Country", "Europe" are all regions. The OP should share more about the semanti

Re: [SQL] replace " with nothing

2011-05-12 Thread Lew
esql.org/docs/9.0/interactive/functions-string.html> <http://www.postgresql.org/docs/9.0/interactive/functions-string.html#FUNCTIONS-STRING-OTHER> replace(string text, from text, to text) -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg -- Sent vi

Re: [SQL] Dates and NULL's`

2011-05-10 Thread Lew
<= "2011/04/30"::date will fail, and so would NULL <= "2011/04/01"::date , since none of these evaluates to TRUE. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] check constraint bug?

2011-05-08 Thread Lew
r precedence than NOT. So the CHECK expression Scott indicated is equivalent to the parenthesis-minimal CHECK ( NOT ( sex = 'f' AND stats IS NOT NULL ) ) or CHECK ( sex != 'f' OR stats IS NULL ) -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf

Re: [SQL] group by hour + distinct

2010-11-26 Thread Lew
docs/9.0/interactive/sql-expressions.html#SQL-SYNTAX-SCALAR-SUBQUERIES> <http://www.postgresql.org/docs/9.0/interactive/functions-subquery.html> Or try: <http://lmgtfy.com/?q=SQL+subquery> -- Lew -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Question regarding indices

2010-09-12 Thread Lew
matter but it's only a WAG. -- Lew -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] is there a distinct function for comma lists ?

2010-09-07 Thread Lew
g/docs/8.4/interactive/functions-subquery.html> It's still true of more than one equal subquery row is found. It's not true multiple times, it's just true. If mytable.id is not unique, then every row with that value will be selected, but adding DISTINCT to the IN list won't ch

Re: [SQL] Common table expression - parsing questions

2009-10-05 Thread Lew
(top-posting corrected) Thomas Kellerer wrote: The standard *requires* the keyword. the6campbells wrote: the db2 [sic] family does not Ergo DB2 is not standard-compliant in that regard. -- Lew -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-19 Thread Lew
quenced and not. For my learning, I use a system on Linux with Java and PostgreSQL. It works just fine. I'm not familiar with Grails. -- Lew -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Odd sort behaviour

2009-09-02 Thread Lew
. That's the point of locales, to formalize such rules so that you can coerce your system to follow one or another set as needed. That way you don't have to agree or disagree with any rule, such as ignoring punctuation in the sort, simply be aware of whether it applies to any give

Re: [SQL] Race condition in resetting a sequence

2007-08-09 Thread Lew
ut this epicyclic dance to accomodate FK references to autoincremented keys makes the case that there is also a performance penalty, and in the more critical performance area of code development and correctness than in the less critical search speed area. -- Lew ---(end o

Re: [SQL] hi

2007-05-19 Thread Lew
ess you pointed out of marking something "confidential" then placing it into the public eye in an archived forum where it will be visible by everybody forever. Now we can publish everything ever written at or by Infinite Computer Solutions without fear of liability. -- Lew

Re: [SQL] Floating point type to store numbers

2007-04-22 Thread Lew
ut to be a big problem. (One quick primer that can help you understand this is at <http://www2.hursley.ibm.com/decimal/decifaq1.html>.) Would you rather have wrong answers really, really fast, or right answers fast enough? -- Lew ---(