SET dollarfrom = '100000000',
dollarto = '400000000'
where gridid = '10303'
and dollarfrom=(select min(dollarfrom) from spgrid_d where gridid='10303' group by gridid)
and dollarto =(select max(dollarto) from spgrid_d where gridid= '10303'group by gridid )
but with the above qry it is not updating bcaz two conditions are not satisfing in single record
first record with min should change and last record with max should change how to implement that in one
single update statement.using inline view can we do if so how it is possible can plz suggest me...
It can't be done in a single statement, because you want to update the dollarfrom of one record and the dollarto of another record.
What your update above tries to do is update both the dollarfrom AND the dollarto of a single record that has dollarfrom = MIN AND dollarto = MAX. There is no such record.
You need 2 update statements I'm afraid.
Mind you I'm getting the impression that this is some kind of homework assignment that says "show how you can update both records at once using an in-line view"! If so, then either the teacher is mistaken, or I am! If you find out how it can be done, please post the answer here!
(I can see how it could be done with a REAL view and an INSTEAD OF trigger, but that would really be overkill just to avoid writing UPDATE twice!)