Convert Cbcriteria To Raw Sql

Is possible to convert a Cdbcriteria to a raw sql???

CActiveRecord does exactly that so it’s technically possible. The difficulty is that some of CDbCriteria’s properties (“with”, “scopes”) has only meaning in the context of a particular child class of CActiveRecord and it means that you cannot simply write a generic function that converts any CDbCriteria to SQL. What’s the actual problem you are trying to solve?