Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using this query for the joining the table pls give me proper solution

SQL
select 
   b.FValue as title, 
   k.FValue as subtitle, 
   c.FValue as isbn, 
   d.FValue as issn,
   E.FValue as Author, 
   f.FValue as roleofauthor,  
   g.FValue as editor, 
   h.FValue as publisher, 
   i.FValue as publisherPlace, 
   j.FValue as pyhsicaldescription,  
   m.FValue as Subject , 
   n.FValue as Note , 
   l.p852 as AccessionNo, 
   l.DateofAcq as AccessionDate,
   l.a852 as location,
   l.Budget as Budget, 
   l.k852 as ClassNo, 
   l.m852 as bookNo ,
   l.Price as Price,
   l.t852 as CopyNo,
   l.Supplier  as supplier ,
   l.b852 as collectionttype,
   l.Material As materials,
   l.status 
from         Biblidetails b  
   left join Biblidetails c on  b.RecID = c.RecID and c.Tag = 020 and c.SbFld = 'a' 
   left join Biblidetails d on b.RecID = d.RecID and d.tag = 022 and d.SbFld = 'a' 
   left join Biblidetails e on  b.RecID = e.RecID and e.Tag = 100 and e.SbFld = 'a' 
   left join Biblidetails f on  b.RecID = f.RecID and f.Tag = 100 and f.SbFld = 'e' 
   left join Biblidetails g on  b.RecID = g.RecID and g.Tag = 250 and g.SbFld = 'a'
   left join Biblidetails h on  b.RecID = h.RecID and h.Tag = 260 and h.SbFld = 'b'
   left join Biblidetails i on  b.RecID = i.RecID and i.Tag = 260 and i.SbFld = 'a'
   left join Biblidetails j on  b.RecID = j.RecID and j.Tag = 300 and j.SbFld = 'a' 
   left join Biblidetails k on  b.RecID = k.RecID and k.Tag = 245 and k.SbFld = 'b' 
   left join Biblidetails m on  b.RecID = m.RecID and m.Tag like '6%' and m.SbFld = 'a'
   left join Biblidetails n on  b.RecID = n.RecID and n.tag like '5%' and n.SbFld = 'a'
   left join location l on b.RecID = l.RecID   where b.Tag = 245 and b.SbFld = 'a'
Posted
Updated 16-Oct-15 23:02pm
v2
Comments
Andy Lanng 17-Oct-15 5:03am    
Really: Code / script has formatting just as sentences have punctuation. We can't help if we can't read your script. Please format your posts in future ^_^
Krunal Rohit 17-Oct-15 7:01am    
Please check your conditions for join.
It may produce more result than you expected.

-KR

1 solution

Try Distinct:

SQL
select distinct
   b.FValue as title, 
   k.FValue as subtitle, 
   c.FValue as isbn, 
   --...
 
Share this answer
 
Comments
Member 11835578 17-Oct-15 5:40am    
i try that but its causes same issue
Member 11835578 17-Oct-15 5:43am    
any other solution for solving that isuuee
Andy Lanng 17-Oct-15 7:35am    
show me your results. Use the "Improve Question" button below your OP to add them

Also, it would help if you had some test data I could use

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900