Search the Community

Showing results for tags 'sql'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Lineage II Development [L2J]
    • Sources
    • Addons & Mods
    • Tools
  • Lineage II Development [L2OFF]
    • Package Files
    • Mods & Extenders
    • Tools
  • Lineage II Client Development
    • Equipments
    • Npcs
    • Maps
    • Tools
    • Skills
  • Lineage II Bots & Tools
    • Bot Systems
    • Bot Scripts
    • Tools
  • Website Templates
  • DenArt Designs's Demo Updater

Forums

  • General Zone
    • Announcements and News
    • Newbies Introduce Urself
    • Maxcheaters Competitions & Events
    • Votes/Polls Area
    • Report Section
    • Downloads Section
  • Lineage II General Section
    • General Discussion [English]
    • Request Support [English]
  • Lineage II Hacks,Cheats and Bots
    • Hacks & Cheats [English]
    • Request Hacks & Cheats [English]
    • Botting [English]
    • Request Botting [English]
  • Lineage II Private Servers
    • L2Tales.com "BЯATVA" High Five x15 - Coming up early October
    • Private Servers
    • L2Elixir Interlude x3 Launching this October
    • [Previews] L2 Private Servers
    • Clans and Alliances
  • Lineage II Marketplace
    • Marketplace [Items & Chars]
    • Marketplace [L2Packs & Files]
    • Marketplace [Powerlvl & Support]
  • Lineage II OFF Server Development
    • Server Development Discussion [L2OFF]
    • Request Server Development Help [L2OFF]
    • Server Shares & Files [L2OFF]
  • Lineage II Java Server Development
    • Server Development Discussion [L2J]
    • Request Server Development Help [L2J]
    • Server Shares & Files [L2J]
    • Private Projects [L2J]
  • Lineage II Client Development
    • Client Development Discussion
  • MMO Games
    • Fortnite
    • PlayerUnknown's Battlegrounds PUBG
    • League of Legends
    • World Of Warcraft Area
    • Other Multiplayer Games
  • General Section
  • Graphics/GFX Zone
  • VIP/Donators Zone
  • MaxCheaters Corner
  • TEST's Topics
  • L2Classic Club's Just trying this thing out
  • Lineage 2 Revolution Club's Discussions
  • Lineage 2 Revolution Club's Tutorials
  • Lineage 2 Revolution Club's Request Help
  • DenArt Designs's Hello and welcome to my club!
  • DenArt Designs's News
  • `Kara for staff's Topics
  • `Kara for staff's Kara`

Product Groups

  • Advertisements
  • Special Groups

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 4 results

  1. Hi guys. I have just one question regarding core side and using the SQL statements to update/insert datas into the database. How could i implement the following query when a new character is created? ("UPDATE characters SET botprev_fail_account = (SELECT botprev_fail_account FROM accounts WHERE account_name=login") I want that the new character that's created on the same account to have the botprev_fail_account value taken from the ACCOUNTS table and inserted into botprev_fail_account from CHARACTERS table. The account_name and login have the same value. The following code that i tried doesn't work: try (Connection con2 = DatabaseFactory.getConnection()) { PreparedStatement statement2 = con2.prepareStatement("UPDATE characters SET botprev_fail_account = (SELECT botprev_fail_account FROM accounts WHERE account_name=?"); statement2.setString(1, _accountName); statement2.executeUpdate(); statement2.close(); }
  2. Hey guys, I have another question for you..... Whenever i try to name a pet inside game I got this error: This is the image of the problem.... Sorry for quallity I did it with phone.... Here is the SQL of my pets table in my DB -- Table structure for pets -- ---------------------------- DROP TABLE IF EXISTS `pets`; CREATE TABLE `pets` ( `item_obj_id` int(10) unsigned NOT NULL, `name` varchar(16) DEFAULT NULL, `level` smallint(2) unsigned NOT NULL, `curHp` int(9) unsigned DEFAULT '0', `curMp` int(9) unsigned DEFAULT '0', `exp` bigint(20) unsigned DEFAULT '0', `sp` int(10) unsigned DEFAULT '0', `fed` int(10) unsigned DEFAULT '0', `ownerId` int(10) NOT NULL DEFAULT '0', `restore` enum('true','false') NOT NULL DEFAULT 'false', PRIMARY KEY (`item_obj_id`), KEY `ownerId` (`ownerId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Any ideas ?? :/
  3. I need sql script that would delete rb's bellow certain lvl. Does anyone have that?
  4. Hi! Since all the SQL tutorials here seem to be very much outdated (non existent). I wanted to write a tutorial on how to write basic SQL statements. SQL is a VERY complex and nasty language, there's so much more to know than I can cover in a simple tutorial, but I will try my best. I will start with a tutorial about selecting data, but if you guys want me to make more for updating, deleting, creating, subqueries, counting, summing or whatever, tell me. Let's say we own a website which has users and these users can all update their profile with a certain country. Our tables look like this: user id country_id name 1 1 Example Name1 2 1 Example Name2 3 2 Example Name3 4 2 Example Name4 5 NULL Example Name5 country id name 1 Australia 2 Germany 3 China The most basic select statement looks like this: SELECT columnname, columnname, columnname FROM tablename; Let’s say we want to select the name and the id of all users, we would write it like this: SELECT id, name FROM user; This will return the name and id of ALL the records. It will look like this: id name 1 Example Name1 2 Example Name2 3 Example Name3 4 Example Name4 5 Example Name5 But what if we only want to know the name and id from the users who live in Australia? We first need to look in our country table and we see that Australia has id 1. Now we have to add a ‘WHERE’ statement to our SELECT. The most basic SELECT WHERE statement looks like this: SELECT columnname, columname, columnname FROM tablename WHERE columname = 'value' OR columname = 'value' AND columnname = 'value'; As you can see, you can add ORs and ANDs to your statement, this works just like you would expect it to work. If you are a programmer, you can see OR as || and AND as &&. Now let’s select our Australian users: SELECT id, name FROM user WHERE country_id = 1; This will return only Australian users. It will look like this: id name 1 Example Name1 2 Example Name2 But what if we want to select id, name and country name? How do we do that? We can do that with a JOIN. There are a lot of different joins; INNER JOIN, OUTER JOIN, RIGHT JOIN, LEFT JOIN, RIGHT OUTER JOIN, etc. This is a lot of information to take in at once, so we’ll keep it simple and narrow this guide down to two JOINs: the LEFT JOIN and the INNER JOIN. So what is the difference? I’ll show you this in the following examples, since writing it down is difficult. The most basic JOIN looks like this: SELECT tablename1.columnname , tablename1.columname, tablename2.columname FROM tablename1 JOIN tablename2 ON tablename2.keycolumn1 = tablename1.keycolumn2; The key columns represent a column belonging to table2 which is also present in table1. Now to ALSO select the country name for all users, we write our SELECT statement like this: SELECT user.id, user.name, country.name FROM user LEFT JOIN country ON country.id = user.country_id; We can add some aliases to make our query a bit more readable: SELECT u.id, u.name, c.name FROM user u LEFT JOIN country c ON c.id = u.country_id; Using aliases is NOT a must, it just comes down to a matter of preference whether you want to use it or not. However if you are selecting two columns with the same column name, in our example this is u.name and c.name, you have to add an alias to one of them. I would do it like this: SELECT u.id, u.name, c.name country_name FROM user u LEFT JOIN country c ON c.id = u.country_id; This query will return the following: id name country_name 1 Example Name1 Australia 2 Example Name2 Australia 3 Example Name3 Germany 4 Example Name4 Germany 5 Example Name5 NULL But wait.. Example Name5 hasn’t got a country_id filled in, what if we only want users who do have a country_id? This is where the INNER JOIN comes in handy, it will remove all those NULL records from the query result. We use the exact same query and only change LEFT JOIN to INNER JOIN, which will look like: SELECT u.id, u.name, c.name country_name FROM user u INNER JOIN country c ON c.id = u.country_id; Now our result is: id name country_name 1 Example Name1 Australia 2 Example Name2 Australia 3 Example Name3 Germany 4 Example Name4 Germany Thanks. PS: I dont own this guide, i copied it from a pdf file to share it with people keep in mind and thanks again.