Hi, i have generated a query of database, but it returns repeated data, can any body correct it...
Query::
SELECT hi_custom_fields.field_id, hi_custom_fields.field_name, hi_custom_field_data.data_id, hi_custom_field_data.value, hi_custom_field_data.comments,
hi_project_fields.project_type_field_id, hi_project_type.project_type_id, hi_project_type.type_short_desc, hi_projects.project_id,
hi_projects.project_title
FROM hi_custom_fields INNER JOIN
hi_custom_field_data ON hi_custom_fields.field_id = hi_custom_field_data.field_id INNER JOIN
hi_project_fields ON hi_custom_fields.field_id = hi_project_fields.field_id INNER JOIN
hi_project_type ON hi_project_fields.project_type_id <> hi_project_type.project_type_id INNER JOIN
hi_projects ON hi_project_type.project_type_id = hi_projects.project_type_id
Regards:
Munwar
[email protected]
Loading
Amit ChoudharyPosted Mar 10, 2010, 4:40 AM
it is quite difficult to analyse the query without having the schema and data. so you if can post the DataBase tables used in this query then i can help you to verify the query and expected reults.
VasanthPosted Mar 10, 2010, 4:25 AM
Meanwhile please post some sample data to resolve easily from our end.
Munwar ZardariPosted Mar 10, 2010, 2:39 AM
thanks for u response.
but istill there is same problem..
Amit ChoudharyPosted Mar 10, 2010, 1:41 AM
i have doubt on this line..
hi_project_fields.project_type_id <> hi_project_type.project_type_id
please check again as you are having inner join and your condition is for <> but i think i should be =. and if you are filtering the data
then you should give another condition for filter. it should not apply with innerjoin condition.