Click here to Skip to main content
14,980,646 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
SQL
select  a.transaction_id, a.slip_date,a.temp_transaction_id,a.transaction_item_group_id,a.transaction_item_type_id,a.product_grade_id, a.unit_id,a.price_per_unit,a.total_price,a.actual_amount,a.paid_amount,a.due_amount,a.buying_agent_id,a.currency_id,a.transactee_type_id, a.quantity,a.lot_id,a.std_quantity,a.finance_type,a.slip_no,a.distribution_type,a.years_reimburse,b.farmerseason,b.regionname,b.zonename,b.sectionname,b.villagename,
a.transactee_id,b.lastname + ' ' + b.firstname + ' ' + b.surname as farmername,
c.transaction_item_type_code,c.transaction_item_type_name,d.transaction_item_group_id,d.transaction_item_group_name,e.location,a.status from [transact].[transaction_item] a,
tbl_farmerregistration_ivorycoast b,[master].[transaction_item_type] c,[master].[transaction_item_group] d,[master].[transaction_location_item_type] e 
where a.transactee_id = b.farmersapcode
 and a.transaction_item_type_id = c.transaction_item_type_id 
 and a.transaction_item_group_id = d.transaction_item_group_id  and e.transaction_item_id = c.transaction_item_type_id 
  and a.status = 'new' and b.isactive = '1' and b.farmersapcode = '1111290'


from the above query how to change into inner join condition

please let me know

What I have tried:

SQL
select  a.transaction_id, a.slip_date,a.temp_transaction_id,a.transaction_item_group_id,a.transaction_item_type_id,a.product_grade_id, a.unit_id,a.price_per_unit,a.total_price,a.actual_amount,a.paid_amount,a.due_amount,a.buying_agent_id,a.currency_id,a.transactee_type_id, a.quantity,a.lot_id,a.std_quantity,a.finance_type,a.slip_no,a.distribution_type,a.years_reimburse,b.farmerseason,b.regionname,b.zonename,b.sectionname,b.villagename,
a.transactee_id,b.lastname + ' ' + b.firstname + ' ' + b.surname as farmername,
c.transaction_item_type_code,c.transaction_item_type_name,d.transaction_item_group_id,d.transaction_item_group_name,e.location,a.status from [transact].[transaction_item] a,
tbl_farmerregistration_ivorycoast b,[master].[transaction_item_type] c,[master].[transaction_item_group] d,[master].[transaction_location_item_type] e 
where a.transactee_id = b.farmersapcode
 and a.transaction_item_type_id = c.transaction_item_type_id 
 and a.transaction_item_group_id = d.transaction_item_group_id
  and e.transaction_item_id = c.transaction_item_type_id 
  and a.status = 'new' and b.isactive = '1' and b.farmersapcode = '1111290'

from the above query how to change into inner join condition

please let me know
Posted
Updated 28-Jun-18 2:18am
v2

1 solution

That is a very old-fashioned way of joining tables. Try
SQL
SELECT  a.transaction_id, a.slip_date,a.temp_transaction_id,a.transaction_item_group_id,
a.transaction_item_type_id,a.product_grade_id, a.unit_id,a.price_per_unit,a.total_price,
a.actual_amount,a.paid_amount,a.due_amount,a.buying_agent_id,a.currency_id,a.transactee_type_id, 
a.quantity,a.lot_id,a.std_quantity,a.finance_type,a.slip_no,a.distribution_type,a.years_reimburse,b.farmerseason,b.regionname,b.zonename,b.sectionname,b.villagename,
a.transactee_id,b.lastname + ' ' + b.firstname + ' ' + b.surname as farmername,
c.transaction_item_type_code,c.transaction_item_type_name,d.transaction_item_group_id,d.transaction_item_group_name,e.location,a.status 

FROM [transact].[transaction_item] a
INNER JOIN tbl_farmerregistration_ivorycoast b ON a.transactee_id = b.farmersapcode
INNER JOIN [master].[transaction_item_type] c ON a.transaction_item_type_id = c.transaction_item_type_id
INNER JOIN [master].[transaction_item_group] d ON a.transaction_item_group_id = d.transaction_item_group_id
INNER JOIN [master].[transaction_location_item_type] e ON e.transaction_item_id = c.transaction_item_type_id 
WHERE 
	a.status = 'new' and b.isactive = '1' and b.farmersapcode = '1111290'
   

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