Register for your free account! | Forgot your password?

You last visited: Today at 11:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Help with query ...

Discussion on Help with query ... within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2017
Posts: 8
Received Thanks: 0
Help with query ...

Hi ..

I have a query to select Item points from char:

Quote:
select SUM(_Items.OptLevel) as ItemPoints
from _Char
right join _Inventory ON _Inventory.CharID =_Char.CharID
right join _Items ON _Items.ID64 in (_Inventory.ItemID)
where _Inventory.Slot between 0 and 12 and _Char.CharID = @CharID
Its work well... But i want add also info from: _InventoryForAvatar where slot = 4 (devil spirit +)

Who can help me сombine a query?
noob2017 is offline  
Old 05/06/2017, 21:29   #2
 
elite*gold: 0
Join Date: Jan 2017
Posts: 8
Received Thanks: 0
bump -.-
noob2017 is offline  
Old 05/08/2017, 02:53   #3
 
Muhab*'s Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 885
Received Thanks: 1,415
This should work.

Quote:
SELECT SUM(OptLevel) ItemPoints
FROM
(
SELECT ItemID FROM _Inventory WHERE Slot BETWEEN 0 AND 12 AND ItemID != 0 AND CharID = @CharID
UNION ALL
SELECT ItemID FROM _InventoryForAvatar WHERE Slot = 4 AND ItemID != 0 AND CharID = @CharID
)
a JOIN _Items b ON a.ItemID = b.ID64
Muhab* is offline  
Thanks
1 User
Old 05/08/2017, 19:03   #4
 
elite*gold: 0
Join Date: Jan 2017
Posts: 8
Received Thanks: 0
Quote:
Originally Posted by Muhab Ashraf View Post
This should work.
Ye this work well, thanks.

But could you please edit this query also .. (for web)

Quote:
select TOP 30 ROW_NUMBER() OVER(order by Level desc, Exp desc, SUM (_items.Optlevel) desc) AS Rank, _Char.CharName16,_Char.NickName16,SUM(_Items.OptLe vel) as ItemPoints,Level, Exp
from _Char
INNER JOIN _CharTrijob ON _CharTrijob.CharID=_Char.CharID
INNER JOIN _Inventory ON _Inventory.CharID =_Char.CharID
INNER join _Items ON _Items.ID64 = _Inventory.ItemID
where _Inventory.Slot between 0 and 12 and JobType = 1 and ItemID != 0
group by _Char.CharName16,_Char.NickName16,Level, Exp
order by Level desc, Exp desc, SUM (_items.Optlevel) desc
noob2017 is offline  
Old 05/09/2017, 04:40   #5
 
Muhab*'s Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 885
Received Thanks: 1,415
Quote:
Originally Posted by noob2017 View Post
Ye this work well, thanks.

But could you please edit this query also .. (for web)
Quote:
SELECT TOP 30 ROW_NUMBER() OVER (ORDER BY SUM(OptLevel) DESC) Rank, c.CharName16, SUM(OptLevel) ItemPoints, c.CurLevel
FROM
(
SELECT CharID, ItemID FROM _Inventory WHERE Slot BETWEEN 0 AND 12 AND ItemID != 0-- AND CharID = @CharID
UNION ALL
SELECT CharID, ItemID FROM _InventoryForAvatar WHERE Slot = 4 AND ItemID != 0-- AND CharID = @CharID
)
a JOIN _Items b ON a.ItemID = b.ID64
JOIN _Char c ON c.CharID = a.CharID
GROUP BY c.CharName16, c.CurLevel
Here is the base working query, You can select more columns and join more tables.
Muhab* is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Release][Query] Query _InvCOS Items WITH _Char Connection
12/29/2015 - SRO PServer Guides & Releases - 1 Replies
Ok, so i needed to write this query for a procedure im working on and not many people know how to connect the pet inventory table to the character table.... so this query will explain how its done... im not going to explain every single detail, like how there is no charcos when pet is despawned / dead... but yea you can probably figure that all out from this query... The code... USE SELECT pet_invo. ,pet_invo. PetSlot
[Suche]Query für "Alteklinge, Reichsklinge" &' Stichdolche NUR QUERY!
08/18/2010 - Metin2 Private Server - 1 Replies
Ich weiß ich werd nervig aber ich suche die Query's für Alteklinge, Reichsklinge &' Strichdolche Why? Naya, weil ich in der DB i-wie nur Drachenmaulglocke hab ... not more -.- Auf jeden Fall Icon's etc. etc. etc. hab ich ich brauche nur die Query's
[Help] need help here register query error
01/22/2009 - EO PServer Hosting - 3 Replies
i cant querry my register account it has error when i run the queryy its says Table account.account doesnt exist. anyboby?



All times are GMT +2. The time now is 11:42.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.