Hi, The code what i need is Simple:
1. I have two tables called as Sequence and the Newsfeed
The newsfeed PK ID is the key which also exists in the sequence table and sequence is stored in newsfeed table,
even the sequence table has the sorting order too but that s not used.
now what i am trying is:
select * from newsfeed where id in (select fk from sequence where pkid = 1000) - if the internal sub query has some records it will give me a some values maybe 5 or 10 records or sometime 1 and if it does not have any record it will return me nothing, now if it returns me nothing, i will do another query which is like this select * from newsfeed where id = 1000 and it will return me the value
then based upon o am getting the sortorder of the id from the newsfeed table.
and then it gives me the record of that table with sortorder
here comes the tricky part:
i am deleting the 5252 record and that 5252 sortorder is 25 so i am deleting 25 and then before 25 its 24 and after 35 it is 26
so what i want s the sorting f the records which are after the deleted records:
so it will be like this;
25 5252 - because this has been deleted
and so on
so the sequence will be have to fixed.
i showed an example of 1 record but if there are more records then that needs to be fixed too,
anyone who bids please understand this structure because this is what i have to do, a udf or single query or stored proc will work here
Max i can pay is $15 Canadian Dollars