One Star

Schema Different from Query

Sirs,
I have the simple need to translate some columns from a table with 7 columns to a table with 3 columns using the rule below...
SELECT CONCAT(DATE(date),' ',HOUR(date),':00:00'),
COUNT(transaction),
operstatus_ID
FROM transactiontable
GROUP BY DATE(date), HOUR(date), operstatus_ID
ORDER BY DATE(date), HOUR(date), operstatus_ID
But I couldn`t do it with success until now... Putting this query in the properties of the component tMySQLInput, I receive that: schema is different from query. The 'Guess Schema' button doesn`t work.
Someone can help me in the creation of my schema?
Lot of thanks.
3 REPLIES
Community Manager

Re: Schema Different from Query

Hello
chema is different from query.

You query more or less coulmns than columns defined on schema, eg you query 4 fields, but there are only 3 fields on schema.
The 'Guess Schema' button doesn`t work.

The 'guess schema' works with a standard query. for example:
"select person.id, person.name from person"
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Schema Different from Query

Thank you Shong!
But... and how I should made this work? Which components? Which procedure?
Community Manager

Re: Schema Different from Query

Hello
In you case, you need define three columns.
date
count
operstatus_ID
please see my screenshot.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business