ADSM-L

Re: Select statements

2002-06-19 11:34:35
Subject: Re: Select statements
From: "Prather, Wanda" <Wanda.Prather AT JHUAPL DOT EDU>
Date: Wed, 19 Jun 2002 11:32:18 -0400
It's an SQL thing.

SQL operations occur in a certain order.
When you do a SELECT to query a table, the results you get back are actually
another (temporary) table.

"where" clauses are applied to columns in the original table
"order" clauses are applied to the columns in the result table

Backup_start isn't in your "results" table, because you didn't ask for that.
Date(backup_start) is a function, not a column name, so that doesn't work,
either.

Naming the column will fix it:

select date(backup_start) as GUMP , node_name , filespace_name from
filespaces where backup_start<=current_timestamp - 110 days order by GUMP


(There is probably a better written explantion for this somewhere, but my
solution for dealing with these SQL issues was to marry a DBA :>)

************************************************************************
Wanda Prather
The Johns Hopkins Applied Physics Lab
443-778-8769
wanda_prather AT jhuapl DOT edu

"Intelligence has much less practical application than you'd think" -
Scott Adams/Dilbert
************************************************************************






<Prev in Thread] Current Thread [Next in Thread>