how to read multiple values in same column and campare it with the same table id and other table to get its record.. i have a table with column name pid ,authors ,citing papers 10.1.1,abc,10.1.2,10.3.2 i want to read citing papers ids sapartly and compare it with pid if it exist in same table then its ok otherwise get its record from another table through same comparison of pid... thanks
|
closed as not a real question by Mark Storey-Smith, Max Vernon, StanleyJohns, dezso, RolandoMySQLDBA Apr 15 at 18:50
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
As others have said, it's really hard to understand what you're asking for with this. Provide an example. For instance, say you have the following two tables:
To join the two by Pid and Authors, returning only matching values, you can use a basic inner join like so:
It's hard to make up more than this from your question, but this should give you an idea how to make basic joins on columns, for instance. It's easy enough to do this basic research on google though. Not to be rude, but if you're asking for answers here, you're probably looking for more answers to more complicated questions, which means you should really define your question as well as possible too. |
|||
|
You can use self join to compare with the same column or different column of the same table. If you can also use CTE if you need repeatable self reference especially with hierarchical data. |
|||
|