Jump to content
Sign in to follow this  
Vasil

[SQL Query Request]IP Selection

Recommended Posts

Hello,right now i am creating some new system that works with Lua-SQL,i am really not good in SQL or making my own SQL Queries so please can anyone reply in this topic an SQL Query that Select an Account IP?

Thanks in Advance

Share this post


Link to post
Share on other sites
Guest

SELECT column FROM table WHERE condition;

...

SELECT last_ip FROM GameDB.dbo.account WHERE act_name = "Vasil";

Share this post


Link to post
Share on other sites

Get IP address by character name:

SELECT a.last_ip FROM GameDB.dbo.account AS a LEFT join GameDB.dbo.character AS c ON (a.act_id = c.act_id) WHERE c.cha_name = 'Vector'

or

SELECT last_ip FROM GameDB.dbo.account WHERE act_id IN (SELECT act_id FROM GameDB.dbo.character WHERE cha_name = 'Vector')

 

similar by character id, but instead of "WHERE cha_name = '...'" use "WHERE cha_id = ID"


Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...