[DB-SIG] SQL query help

Siggy Brentrup bsb@winnegan.de
07 Mar 2001 21:16:25 +0100

"Ryan Weisenberger" <ryanw@inktomi.com> writes:

> Does anyone know how to get at tables with spaces in the name?  The
> Microsoft SQL Server 2000 demo database is loaded with tables with
> names like "Order Details".
> I've tried a few combinations:
> c.execute("select * from order details")
> c.execute("select * from order-details")
> c.execute("select * from order_details")
> c.execute("select * from 'order details'")
> c.execute("select * from order%20details")

Dunno if this works with SQL server, I'm using it with PostgreSQL

c.execute('select * from "order details"')

In PostgreSQL names in double quotes are case sensitive, YMMV