Well, normally "in" is used like so....

select node_name, filespace_name, other_details from filespaces where
node_name in (select node_name from nodes where domain='TARGETDOMAIN') or
node_name in ('NODE1','NODE2','NODE3')

So, you're saying node_name is "in" (ie, is a member of) a list of objects.
The list can either be explicitely defined, as the node1/node2/node3 list
object, or can be genereated using another select statement, such as the
TARGETDOMAIN select statement.

If you're using 3.7 server or later, you might try something like,

select entity, successful, start_time, end_time, schedule_name from summary
where entity in (select node_name from nodes where domain_name='CRITICAL' or
domain_name='STANDARD')

Or, 3.1, I don't know if this'll work, but it might give you a starting
place,

select events.node_name, events.actual_start, filespaces.backup_end from
events, filespaces where events.node_name=filespaces.node_name and
(events.domain_name='CRITICAL' or events.domain_name='STANDARD')

BUT, since an event can be successful even if the backup died in the middle
of the filespace, I would suggest considering...

select node_name, filespace_name, backup_start, backup_end from filespaces
where backup_end < (current_timestamp - (1 day)) and node_name in (select
node_name from nodes where domain_name in ('CRITICAL','STANDARD'))

Good luck, and I hope this helps.

Alex

-----Original Message-----
From: Anderson, Michael - HMIS [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 27, 2001 10:04 AM
To: [EMAIL PROTECTED]
Subject: Select Problem


    I am trying to use a select statement to query the events table to get
the node name, start time and status and , then get
  the end time from the filespaces table and pipe them to a file. When I
issue the command it keeps getting an error in
  the output file as follows:

   ANR2904E Unexpected SQL key word token - 'IN'


  The command I issue is as follows from the command line:

adsm> select node_name as "server name",time(actual_start) as "start time",
stat
us from events where domain_name='CRITICAL' or domain_name='STANDARD' and
node_n
ame=nodename in (Select time(backup_end) as "endtime"from filespaces) >>
d:\res
tore\sql2.log
Output of command redirected to file 'D:\RESTORE\SQL2.LOG'
ANS8001I Return code 3.

  Any help would be appreciated

  Mike Anderson
  [EMAIL PROTECTED]




CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
is for the sole use of the intended recipient(s) and may contain
confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.

"WorldSecure <Freightliner.com>" made the following
 annotations on 08/27/01 11:06:54
------------------------------------------------------------------------------

[INFO] -- Content Manager:
The information contained in this communication is confidential and intended solely 
for the use of the individual to whom it is addressed and others authorized to receive 
it.  If you are not the intended recipient, any disclosure, copying, distribution or 
taking of any action in reliance on the contents of this information is prohibited. If 
you have received this communication in error, please immediately notify the sender by 
phone if possible or via email message.

==============================================================================

Reply via email to