This is the mysql code written for ruby on rails application
Model.find_by_sql(["SELECT * FROM domainurls WHERE domaindetail_id = ?",@id ,"and count IN (SELECT Max( count ) FROM domainurls WHERE domaindetail_id =?",@id,")"])
It gives me error
"error is: wrong number of arguments (0 for 1)"
Can anybody have idea what’s wrong in the code?
Here you require data in two query because of IN can search data within an array.
Either your query
will return many column.
So first execute this query and take counts in a array and after that execute second query.
I think you have understood.