如何使用多个objectForKey对NSMutableDictionaries的NSMutableArray进行排序(How to sort an NSMutableArray of NSMutableDictionaries using mutiple objectForKey)
我有一个NSmutableArray中有几十个NSMutableDictionaries。
每个NSMutableDictionary看起来像这样
insComp = F; insFlow = "suVE"; inID = "SJF42B"; ID = 10000038;
然后我想知道我是如何对几个NSDictionary键进行分类的。 为每个对象实例。
insComp> inID> ID
例如,不使用相同的键或值
-- obj1 var1 = A var2 = A -- obj2 var1 = A var2 = B -- obj3 var1 = B var2 = A -- obj4 var1 = C var2 = A
所以这将首先通过var1进行排序,然后对每个var1-var2进行排序,依此类推。 我认为它被称为树排序?
任何帮助将不胜感激。
I have a NSmutableArray with dozens of NSMutableDictionaries in it.
Each NSMutableDictionary looks something like this
insComp = F; insFlow = "suVE"; inID = "SJF42B"; ID = 10000038;
I would then like to know how I sort acending values by several of the NSDictionary keys. for each object instance.
insComp > inID > ID
for example, not using same keys or values
-- obj1 var1 = A var2 = A -- obj2 var1 = A var2 = B -- obj3 var1 = B var2 = A -- obj4 var1 = C var2 = A
So that would be sorting first by var1 then every var1-var2 is sorted and so on. I think its refered to as a tree sort?
any help would be greatly appreciated.
原文:https://stackoverflow.com/questions/19422463
最满意答案
尝试在查询中分隔您的买卖字段,如下所示:
DELETE FROM price WHERE date LIKE '%2016-07-27%' AND (buy NOT LIKE '{$min}' AND buy NOT LIKE '{$max}') AND (sell NOT LIKE '{$min}' AND sell NOT LIKE '{$max}')
Try seperating your buy and sell fields in the query like this:
DELETE FROM price WHERE date LIKE '%2016-07-27%' AND (buy NOT LIKE '{$min}' AND buy NOT LIKE '{$max}') AND (sell NOT LIKE '{$min}' AND sell NOT LIKE '{$max}')
相关问答
更多-
如何使用PL / SQL从不同的表中删除(删除)多个用户(How to remove(delete) multiple users from different tables using PL/SQL)[2023-08-16]
您可以按照 Tony Andrews的建议创建程序 。 程序 Create or replace Procedure Delete_user (l_code_name IN your_users.cod_name%type, -- Declare your IN parameters here l_code IN your_users.cod_emp%type, l_code_id IN your_users.cod_id%type, l_code_user IN your_u ... -
如何在SQL Server中使用INNER JOIN从多个表中删除(How do I delete from multiple tables using INNER JOIN in SQL server)[2022-02-05]
您可以利用此示例中的“已删除”伪表。 就像是: begin transaction; declare @deletedIds table ( id int ); delete t1 output deleted.id into @deletedIds from table1 t1 join table2 t2 on t2.id = t1.id join table3 t3 on t3.id = t2.id; delete t2 ... -
(首先让我说我知道DB) 我知道您要删除旧的上传内容。 而不是这样做,重写C#/ asp.NET代码只显示40天以下的上传。 (First off let me say I know the DB) I know you want to delete the old uploads. Instead of doing so,, rewrite the C#/asp.NET code to show only uploads that are younger then 40 days.
-
我认为你的第三个陈述应该可行,但我会用左连接来构建它。 请尝试以下SQL更新: DELETE users, pets, report, user_files FROM users LEFT JOIN pets ON (pets.pet_user_id=users.user_id) LEFT JOIN report ON (report.rep_user_id=users.user_id) LEFT JOIN user_files ON (user_files.file_user_id=users.user ...
-
SQL删除多个地方和类似(SQL Delete Multiple Where And Like)[2022-04-29]
尝试在查询中分隔您的买卖字段,如下所示: DELETE FROM price WHERE date LIKE '%2016-07-27%' AND (buy NOT LIKE '{$min}' AND buy NOT LIKE '{$max}') AND (sell NOT LIKE '{$min}' AND sell NOT LIKE '{$max}') Try seperating your buy and sell fields in the query like this: ... -
这是在sql server中删除多个作业的正确方法(which is the correct way to delete multiple jobs in sql server)[2023-10-14]
我会使用方法1因为它简单而有效。 之前无需禁用该作业。 如果在作业运行时删除作业,作业将因错误而终止,因此请检查是否需要该作业。 处理此问题的方法(由OP发布): IF exists( select 1 from msdb.dbo.sysjobactivity activity where activity.run_Requested_date is not null and activity.stop_execution_date is null ... -
您可以使用CTE选择所有不应删除的记录,然后您可以将其与原始表连接: WITH Keep AS ( SELECT ID=1234, Sub_ID=2 UNION ALL SELECT ID=4321, Sub_ID=2 ) SELECT t.* FROM Table1 t INNER JOIN Keep k ON t.ID = k.ID AND t.Sub_ID = k.Sub_ID 这显示了你将保留的内容: 演示 如果要删除另一个,可以使用NOT EXISTS ...
-
我先删除我的孩子收藏: delete rota_alerta where rota_id in(select id_rota from rota where ID_UTILIZADOR=26) delete pedido where rota_id in(select rota_id from rota where ID_UTILIZADOR=26) delete rota where ID_UTILIZADOR=26 i'd delete my child collections first: dele ...
-
这应该工作。 我保留所有max id并删除剩余的行: DELETE FROM Yourtable WHERE id NOT IN ( SELECT MAX(id) FROM Yourtable GROUP BY AppEmployeeID ); This should work. I am retaining all max ids and deleting the remaining rows: D ...
-
您希望根据列匹配删除TableA中TableA中的行。 这样做怎么样: delete from tableA where exists (select 1 from tableB where tableA.Column1 = tableB.Column1 and tableA.column2 = tableB.column2 ); 这似乎是你想要做的事情的意图。 You want to del ...