tags:

views:

29

answers:

1

I have seen this done before but i can't remember where i saw it.

What i need to do is have the table name as a field in a query

Say i have a table called users, how would i add the table name 'users' as a column

like

 SELECT username, password, **table** as mytable FROM users
+1  A: 

It may look obvious, but did you consider the following?

SELECT username, password, 'users' as mytable FROM users
Daniel Vassallo
So obvious and it works....thanks
AdRock