Create a Custom SQL Server for Checking and deleting

Lukket Lagt ut 5 år siden Betales ved levering
Lukket Betales ved levering

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:

sortorder: ID

25 5252

26 5255

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;

sortorder: ID

25 5252 - because this has been deleted

25 5255

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

Thanks

Max i can pay is $15 Canadian Dollars

Microsoft SQL Server SQL

Prosjekt-ID: #17213367

Om prosjektet

21 bud Eksternt prosjekt Aktiv 5 år siden

21 frilansere byr i gjennomsnitt $25 for denne jobben

vw7590795vw

Please message me and send me some sample data. Please review my profile. https://www.freelancer.com/u/vw7590795vw.html I have 8 years and 6 months experience in SQL Server. Please let me know more details and when Mer

$14 CAD på 1 dag
(24 Omtaler)
4.2
AntonBliznetc

Hello I can do that in less 2 hours. Task more for reviews. Result 1 QUERY. Thank. ____________________

$15 CAD på 0 dager
(13 Omtaler)
3.4
ohmygolly

You need a trigger that fires after delete row which updates then every subsequent row. I'll do it in one day

$15 CAD på 1 dag
(0 Omtaler)
0.0
aetsvetkov

As far as I understand you want that deleted record still returned in query? Thats not so difficult. Another problem is that deleted record should not affect ordering number. I don't know how you assign that number Mer

$15 CAD på 1 dag
(0 Omtaler)
0.0
jmcdador

I have sufficient experience in SQL Relevant Skills and Experience Oracle PL/SQL MySQL SQL Server

$20 CAD på 1 dag
(0 Omtaler)
0.0
dkjain1406

I am new at freelancer.in but I have many years of experience in SQL Server. Written many complex queries. To be more flexible, I would like to write stored procedure here . in your example: "i am deleting the 52 Mer

$15 CAD på 2 dager
(0 Omtaler)
0.0
mohitsaini31

I have 13 years experience relevant to managing MIS of National Level Project, designing, development of the application in ASP.NET/VB.NET and SQL server. I have also developed the e-payment system through direct payme Mer

$10 CAD på 1 dag
(0 Omtaler)
0.0
klokeshforever

We can get this done by using a temporary table. Or by modifying sort order after deletion or insertion by decrementing or incrementing that column from the modified value column Relevant Skills and Experience I have Mer

$15 CAD på 6 dager
(0 Omtaler)
0.0
mohdmujtabaali

Hi! We can work further also. I am full time sql developer in 1 erp vendor company in hyderabad India. I have more than 6 years of experience working on sql. Regards, Mujtaba. Whatsapp; +919032805349 Relevant Skills Mer

$15 CAD på 1 dag
(0 Omtaler)
0.0
jackvera

Good Morning, I need more information about the process you make, maybe by skype you can show me to mke a better construction. basically, the process has two elements, the one you describe and a LOG of process. I going Mer

$138 CAD på 3 dager
(0 Omtaler)
0.0