Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Converting Complex Sql Query To Querybuilder

$
0
0
I have several SQL queries that work via command line, but would like to convert them to QueryBuilder due to issues with CDbConnection::createCommand recognizing valid variables.

The SQL is

    INSERT INTO bgt.question_mappings(parentId, childId)
    SELECT parentId, NID FROM bgt.question_mappings
    WHERE bgt.question_mappings.childId = PID
    UNION SELECT ALL NID, NID


Any idea how I can adapt this SQL to QueryBuilder?

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>