The following sql statement is not giving the right output, can anyone help
I have 3 tables 1) workorder 2) matusetrans 3)wpmaterial
table 1 has 1 record, t2 has 2 record & t3 has 2 record
when i join them i am getting 4 records in which 2 records are duplicated, is there any way i can stop displaying the duplicate record, note i have used DISTINCT but it did not work.
"SELECT matusetrans.itemnum, matusetrans.transdate, matusetrans.quantity,
matusetrans.issuetype, matusetrans.description, wpmaterial.itemqty,
FROM matusetrans, wpmaterial, workorder.wonum
WHERE ( (Workorder.wonum= '108875')
AND (matusetrans.refwo = wpmaterial.wonum)
AND (Workorder.wonum = wpmaterial.wonum)
AND (matusetrans.issuetype = 'ISSUE')
Hi, Sarah_1985. Since the three tables, workorder, matusetrans, and wpmaterial, contain few records, it would help if you could share the records. Also, may I know what you are trying to get from the query?
The reason why the distinct doesnt work is one field is diferent - Identify that field and exclude it from your select statement. If it is a field that you need, then exculde the other info in the where clause.