MySQL Forums
Forum List  »  Stored Procedures

Re: Display all the records from table using cursor
Posted by: kaji Pasa
Date: September 25, 2017 12:49PM

Here is the requirement.
I have two tables base_table b and master table m with columns
standarttitle,Title_sci,issn1,issn2,confidence_check(CC),Title,issn,eissn,database

Here is no any primary key.
role of CC: if base.title_sci = base.title or b.issn1=b.issn2 or b.issn=b.eissn then this is match and CC=0 else cc=1 .
for the rows if cc is not zero then i have to see those records in a master table.
The data in the master table is a repository to make the mapping (match) of such incorrect records we know that will happen,and consider those to be match.so in master table if i have dog=cat and master.cc= 0 for tiitle_sci and title columns and if i find in base table title_sci = "dog" and title= "cat" I have to update CC to 0 from 1 in base table .But if dog=cat and cc=1 in master then we don't have to deal with that in base. Just escape it.

Or if the record in master has cc=0 we have to find the corresponding row in base table and make it 0.

The master table also has same table structure as base table. I am trying to update cc to 0 from 1 if for each row from base and master table, if
base.title_sci=master.title_sci
and b.issn1=m.issn1
and b.issn2=m.issn2
and b.title=m.title
and b.issn=m.issn
and b.eissn=m.eissn and
b.databas=m.databas

For some records we have distinct record only because we have different database value, all other columns have duplicate record
for eg
base table record is as follows
************************************************

StandardTitle Title_sci, | ISSN1 | ISSN2 |CC| Title, ISSN | eISSN | Databas
------------------------|-------------------------------|----------|------------|--|----------------------------------------------------------------------
ALZHEIMERSANDDEMENTIA, | Alzheimers and Dementia|1552-5260 | 1552-5279 |1 | Alzheimers & Dementia | NULL| 2352-8729 | PubMed Central
ALZHEIMERSANDDEMENTIA, | Alzheimers and Dementia |1552-5260 | 1552-5279 |1 | Alzheimers & Dementia | NULL| 2352-8729 | ScienceDirect Open Access Titles

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Display all the records from table using cursor
803
September 25, 2017 12:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.