I am trying to add a column in zf2 to a select statement. Similar to the below link (but below only seems to work for ZF1). Is there a way to do this in zf2?
Zend DB Selecting constants - columns that do not exist in table
Below is what I tried:
$select->columns("foo" => new \Zend\Db\Sql\Expression('"foo" as type'))
The SQL Query looks like this:
select *, 'foo' from bar
Where foo is the value and name of column for all results. Trying the above I get "Unknown column 'foo' in 'field list'"
Many Thanks, M