How get PlayerName by ID

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

How get PlayerName by ID

Postby kpalych » Fri May 16, 2008 7:03 am

I understand how get, for example PocketCards by ID - "lookup_from_id( id, 'cardpair')". But I can not find in documentation how get PlayerName by ID...

There are only this valid lookups: 'blindsbb', 'blindsdesc', 'sitename', 'siteabbr', 'cardpair', 'card', 'card_rank', 'finalhand', 'month', 'tourneytabletype', 'tourneytype'

What can I do when I whant get some informatin from lookup tables by ID exclude valid lookups (PlayerName for example).

Thanks.
kpalych
 
Posts: 9
Joined: Wed May 07, 2008 3:01 am

Re: How get PlayerName by ID

Postby Josh » Fri May 16, 2008 10:12 am

You need to use the column for the player name if it's available, if not you need to create one linking to the player.player_name database field.
Josh
Site Admin
 
Posts: 6222
Joined: Sat Dec 08, 2007 6:03 pm

Re: How get PlayerName by ID

Postby Seitz333 » Sat May 17, 2008 10:36 am

You could run your own query against the table 'player' using the query tool in pgAdmin.
Here is the SQL statement:

Code: Select all
SELECT player.player_name, player.id_player
FROM player
WHERE player.id_player > 0
ORDER BY player.player_name ASC


Chuck
Seitz333
 
Posts: 71
Joined: Sun Feb 24, 2008 8:14 pm


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 2 guests