Database-independant SQL String Concatenation in Rails

Posted by Craig Walker on Stack Overflow See other posts from Stack Overflow or by Craig Walker
Published on 2010-06-06T23:46:37Z Indexed on 2010/06/06 23:52 UTC
Read the original article Hit count: 406

I want to do a database-side string concatenation in a Rails query, and do it in database-independent way.

SQL-92 specifies double-bar (||) as the concatenation operator. Unfortunately it looks like MS SQL Server doesn't support it; it uses + instead.

I'm guessing that Rails' SQL grammar abstraction has solved the db-specific operator problem already. If it does exist, how do I use it?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server