|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Development::Database/World Building World Building forum, dedicated to the EQEmu MySQL Database. Post partial/complete databases for spawns, items, etc. |

08-24-2009, 05:48 AM
|
Hill Giant
|
|
Join Date: Nov 2002
Location: NC, USA
Posts: 182
|
|
Quickest way I can think of is to make a list of all the item id's required by the spells, then just run a query in your choice of MySQL browser selecting for any entries with those ids. Back those up, wipe the table, then restore, and you have yourself an empty table.
__________________
Hmm.
|

08-24-2009, 04:10 PM
|
 |
Demi-God
|
|
Join Date: May 2007
Location: b
Posts: 1,449
|
|
Simpler way is to use excel or a similar program to make a query for you. You can sort by reagent ID in navicat, and copy-paste it into excel. Something like
Code:
"Select * from items where id = (id from navicat) and
id = | (next id from navicat) | and"
with the | being a delimiter for the cell. Then, you can copy-paste into navicat, run the query, and use navicat's export tools to export all of the item IDs that are used by the spells table, and then empty the table (also using navicat) and import the SQL you also exported. Try that, see if it works.
If all else fails look into JOIN queries.
Protip: Navicat's ordering views + Excel = heaven.
|

08-25-2009, 01:26 AM
|
Forum Guide
|
|
Join Date: Sep 2003
Location: California
Posts: 1,474
|
|
Please use a simplied sql query rather than a long string
Code:
SELECT name from items i where id IN (1003,1001,1002)
returns name where item id = 1001-1003
GeorgeS
|

08-25-2009, 03:14 AM
|
Developer
|
|
Join Date: Mar 2007
Location: Ohio
Posts: 648
|
|
I'm sure the syntax is 100% correct, but you should be able to do something like this:
Code:
DELETE FROM items
WHERE id NOT IN (
(SELECT components1 FROM spells_new WHERE components1 > 1000),
(SELECT components2 FROM spells_new WHERE components2 > 1000),
(SELECT components3 FROM spells_new WHERE components3 > 1000),
(SELECT components4 FROM spells_new WHERE components4 > 1000),
(SELECT NoexpendReagent1 FROM spells_new WHERE NoexpendReagent1 > 1000),
(SELECT NoexpendReagent2 FROM spells_new WHERE NoexpendReagent2 > 1000),
(SELECT NoexpendReagent3 FROM spells_new WHERE NoexpendReagent3 > 1000),
(SELECT NoexpendReagent4 FROM spells_new WHERE NoexpendReagent4 > 1000)
)
|

08-25-2009, 11:51 AM
|
 |
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
Quote:
Originally Posted by AndMetal
I'm sure the syntax is 100% correct, but you should be able to do something like this:
Code:
DELETE FROM items
WHERE id NOT IN (
(SELECT components1 FROM spells_new WHERE components1 > 1000),
(SELECT components2 FROM spells_new WHERE components2 > 1000),
(SELECT components3 FROM spells_new WHERE components3 > 1000),
(SELECT components4 FROM spells_new WHERE components4 > 1000),
(SELECT NoexpendReagent1 FROM spells_new WHERE NoexpendReagent1 > 1000),
(SELECT NoexpendReagent2 FROM spells_new WHERE NoexpendReagent2 > 1000),
(SELECT NoexpendReagent3 FROM spells_new WHERE NoexpendReagent3 > 1000),
(SELECT NoexpendReagent4 FROM spells_new WHERE NoexpendReagent4 > 1000)
)
|
effect_base_value1, 2, 3, and 4 are also used, to summon items I believe.
|
 |
|
 |

08-25-2009, 03:09 PM
|
Dragon
|
|
Join Date: Oct 2003
Posts: 511
|
|
Quote:
Originally Posted by AndMetal
I'm sure the syntax is 100% correct, but you should be able to do something like this:
Code:
DELETE FROM items
WHERE id NOT IN (
(SELECT components1 FROM spells_new WHERE components1 > 1000),
(SELECT components2 FROM spells_new WHERE components2 > 1000),
(SELECT components3 FROM spells_new WHERE components3 > 1000),
(SELECT components4 FROM spells_new WHERE components4 > 1000),
(SELECT NoexpendReagent1 FROM spells_new WHERE NoexpendReagent1 > 1000),
(SELECT NoexpendReagent2 FROM spells_new WHERE NoexpendReagent2 > 1000),
(SELECT NoexpendReagent3 FROM spells_new WHERE NoexpendReagent3 > 1000),
(SELECT NoexpendReagent4 FROM spells_new WHERE NoexpendReagent4 > 1000)
)
|
With a little modification adding the fields Cavedude specified this will give me exactly what I needed. Thank you everyone for your help!
__________________
How about the power to kill a yak from 200 yards away...WITH MIND BULLETS! thats telekinesis kyle.
|
 |
|
 |

08-25-2009, 06:30 PM
|
Dragon
|
|
Join Date: Oct 2003
Posts: 511
|
|
Hmm, while the syntax throws no errors there is something wrong with the statements logic as it deletes no items at all, looking into it.
Edit - When running this through an sql validator I get this
The following feature outside Core SQL-200x (draft) is used:
F561, "Full value expressions""
__________________
How about the power to kill a yak from 200 yards away...WITH MIND BULLETS! thats telekinesis kyle.
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 10:57 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |