<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">#sqlite does not have problem with this, but postgres has. (and i guess any #other more strict DB).<br>
#This functionality is being used in polymorphic_union()</p>
<p dir="auto">from sqlalchemy import *<br>
db = create_engine( 'sqlite:///:memory:')<br>
meta = BoundMetaData( db)</p>
<p dir="auto">table_A = Table( 'A', meta,<br>
Column( 'name', type= String, ),<br>
Column( 'id', primary_key= True, type= Integer ),<br>
Column( 'atype', type= String, ),<br>
)</p>
<p dir="auto">table_B = Table( 'B', meta,<br>
Column( 'bdata', type= String, ),<br>
Column( 'id', Integer, ForeignKey( 'A.id', ), primary_key= True ),<br>
)</p>
<p dir="auto">selB = table_A.join( table_B).select( table_A.c.atype == 'B' )<br>
print '---', selB</p>
<p dir="auto">selselB = select( selB.columns)<br>
print '===', selselB</p>
<p dir="auto">:::::::::: results in:</p>
<p dir="auto">--- SELECT "A".name, "A".id, "A".atype, "B".bdata, "B".id<br>
FROM "A" JOIN "B" ON "A".id = "B".id<br>
WHERE "A".atype = ?</p>
<p dir="auto">=== SELECT name, id, atype, bdata<br>
FROM (SELECT "A".name AS name, "A".id AS id, "A".atype AS<br>
atype, "B".bdata AS bdata, "B".id AS id<br>
FROM "A" JOIN "B" ON "A".id = "B".id<br>
WHERE "A".atype = ?)</p>
<p dir="auto">=======<br>
note both "A".id AS id  , "B".id AS id</p>
<p dir="auto"><strong>Migrated issue, originally created by Dan Stovall</strong></p>
<p dir="auto">In MSSQL a ROWVERSION or TIMESTAMP column do not contain a date time.  Instead the contain an 8-byte integer.  Currently, the column is set as sqlachemy.sql.sqltypes.TIMESTAMP, which is an instance of the DateTime type.  Running a query against a table with such a column returns a byte string value for those columns.  The mssql dialect should probably have a specific ROWVERSION type and it should be an integer, not a DateTime.  Also, it would be nice if the values of those columns returned an integer by using int.from_bytes to convert the byte string.</p>