Re: Yet another newbie question

From: Sashi <smalladi_at_gmail.com>
Date: Thu, 3 Sep 2009 08:19:45 -0700 (PDT)
Message-ID: <cc5547e1-a687-4d69-a888-473ed2fce090_at_t2g2000yqn.googlegroups.com>



Thanks for the pointers, guys.

This is what I've come up with:

update A
set a.col1 = 'something'
where exists
(select 1
from B
where a.col2>=b.col2 and a.col3<=b.col3 )

Is my syntax correct for what I'm aiming to do? As for what I'm aiming to do, I hope it's clear.

I have two tables, A and B and a column in A needs to be updated to true if two columns in A (source and destination) fall in a range, given that all ranges are in table B as two columns (start and end).

And the syntax I quoted is from Sybase, which is where I acquired it.

Thanks,
Sashi Received on Thu Sep 03 2009 - 10:19:45 CDT

Original text of this message