:select

Hi
   This is just an example .I have a model Person with fields
first_name, last_name
And after entering some records to the people table I tried the sql
Person.find(:all,:select => "first_name,#{first_name+last_name} as
full_name")

      But this is not working Could anybody please tell how can I make
it work My ntention only just get result like
first_name full_name
abc abc d
AG AG h

Thanks

Hi
This is just an example .I have a model Person with fields
first_name, last_name
And after entering some records to the people table I tried the sql
Person.find(:all,:select => "first_name,#{first_name+last_name} as
full_name")

You don't need the #{} in there.

Fred

But when I do that I get error
INT: No operator matches the given name and argument type(s). You might
need to add explicit type casts.
: SELECT first_name, first_name+last_name as full_name FROM "people"

But when I do that I get error
INT: No operator matches the given name and argument type(s). You might
need to add explicit type casts.

check your database documentation for the appropriate way to
concatenate two strings.

Fred