[mysql] JSON数据操作

/ 30,474评论 / 125203阅读 / 0点赞

前言

在MySql中使用

声明json类型的字段

create table test(
    uids json not null default ('[]')
);
default ('[{"name":"coolight"}, {"name","洛天依"}]')
或
default ("[{'name':'coolight'}, {'name','洛天依'}]")

Mysql中常用的操作json函数

JSON_LENGTH(json1)=JSON_LENGTH(json2) and JSON_CONTAINS(json1, json2)
// 例如:
update test set enable=true where JSON_LENGTH(json1)=JSON_LENGTH(json2) and JSON_CONTAINS(json1, json2);
// 示例:在数组末尾追加元素
SELECT JSON_ARRAY_APPEND('[1, 2, 3]', '$', 4); 
// 得到 [1,2,3,4]

// 示例:对数组添加一个元素,如果已经存在则不添加
// ["1000000", "1000001", "1000002"]
update test set uids=json_array_append(uids, '$','1000001') where id=777 and JSON_CONTAINS(uids,JSON_ARRAY('1000001'))=0;
// 没有添加,注意where ... and 后面 使用JSON_CONTAINS判断了是否包含准备添加的元素
// ["1000000", "1000001", "1000002"]
update test set uids=json_remove(uids, JSON_UNQUOTE(JSON_SEARCH(uids, 'one','1000001'))) where id=777;
// ["1000000", "1000002"]
create TRIGGER auto_reset after insert on test for each row
BEGIN
    update test set uids=json_array_append(uids, '$', CAST(NEW.uid as char)) where id=NEW.id;
END;
  1. Lazrmbf说道:

    Добрый день!
    Мы можем предложить дипломы психологов, юристов, экономистов и других профессий по доступным тарифам.
    kiopro.ru/support/forum/view_profile.php?UID=72504

  2. Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт бытовой техники

  3. Jessesaf说道:

    The Value of Vibration Management Equipment in Machinery
    In production settings, equipment along with rotational equipment act as the support of output. Nonetheless, a of the highly prevalent concerns that could impede their operation as well as longevity is vibrations. Resonance might lead to a array of challenges, including decreased precision and productivity resulting in heightened erosion, finally resulting in costly interruptions as well as maintenance. Such a situation is where resonance control equipment becomes necessary.

    Why Vibrations Mitigation is Important

    Vibration in equipment can cause numerous adverse effects:

    Lowered Operational Efficiency: Excessive vibrations might bring about misalignment and unbalance, minimizing total performance of the machinery. This could bring about slower output times along with higher energy consumption.

    Increased Erosion: Ongoing resonance increases the damage to mechanical parts, causing more regular maintenance along with an potential of unexpected unexpected failures. This not only raises operating costs and reduces the lifetime of the equipment.

    Safety Concerns: Unchecked vibration can bring significant security risks to both the equipment and the machinery as well as the workers. In, serious conditions, this could result in devastating equipment failure, endangering workers and causing extensive damage to the site.

    Precision as well as Production Quality Challenges: Within sectors that require exact measurements, such as production or aviation, oscillations may cause discrepancies during production, producing defects and increased waste.

    Reasonably Priced Approaches to Vibration Regulation

    Investing in vibration control tools remains not only necessary but a smart decision for any business any company that relies on machines. The offered modern vibration control systems are engineered to reduce vibrations from any machinery and rotational systems, guaranteeing smooth as well as productive processes.

    What distinguishes such equipment apart remains its affordability. We understand the importance of affordability in the current market, and for that reason we have top-tier vibration management solutions at costs that won’t break the bank.

    By choosing these tools, you aren’t simply securing your machines as well as increasing its performance you’re also putting resources into the sustained success of your operations.

    Conclusion

    Resonance mitigation is a critical element of maintaining the operational performance, protection, along with durability of your industrial equipment. Using these reasonably priced vibration control equipment, one can be certain your operations run smoothly, all manufactured items maintain high quality, as well as your workers remain safe. Don’t allow resonance affect your machinery—invest in the right equipment today.

  4. Если вы искали где отремонтировать сломаную технику, обратите внимание – профи услуги

  5. dublikaty_waoa说道:

    Как не допустить дублирование номеров при оформлении автомобиля, Практические рекомендации по разрешению проблемы с дублированным номером авто, Узнайте, есть ли дублированный номер на вашей машине, Как избежать неприятных последствий из-за повторения номера на машине.
    дубликат номера на машину https://www.gosnomer-dublikat.ru/ .

  6. Если вы искали где отремонтировать сломаную технику, обратите внимание – сервисный центр в челябинске

  7. Sazrmqw说道:

    Привет!
    Приобрести документ университета
    fanpesni.ru/raznoe/nyuansyi-pokupki-pechi-kamina-dlya-doma-i-bani

  8. Sazrlrn说道:

    Привет, друзья!
    Заказать документ о получении высшего образования
    cse.google.com.af/url?sa=t&url=aurus-diploms.com

  9. Sazryvh说道:

    Привет, друзья!
    Купить документ ВУЗа
    shamrockrfc.com/

  10. Sazrmjq说道:

    Здравствуйте!
    Приобрести документ о получении высшего образования
    obrezanie05.ru/users/15?page=4

  11. Sazrwfj说道:

    Добрый день!
    Заказать документ ВУЗа
    enote-store.ru/?rz=a

  12. Если вы искали где отремонтировать сломаную технику, обратите внимание – профи ремонт

  13. Jessesaf说道:

    vibration analysis
    The Cruciality of Resonance Control Systems in Machinery
    Inside industrial contexts, machines as well as turning devices are the foundation of operations. Nonetheless, a of the most widespread challenges that may hinder its functionality as well as longevity remains oscillation. Resonance may result in a variety of challenges, from reduced accuracy and productivity resulting in elevated wear and tear, ultimately leading to pricey downtime and restoration. This is the point where vibration management tools becomes necessary.

    Why Vibration Management is Crucial

    Vibration within machinery can lead to several harmful effects:

    Decreased Functional Effectiveness: Excessive vibration might result in discrepancies along with distortion, lowering the effectiveness of such devices. Such might cause slower production schedules as well as greater energy consumption.

    Increased Erosion: Persistent vibrations increases overall damage of equipment components, bringing about more frequent repairs and the chance of unexpected unforeseen malfunctions. This does not just raises operating costs and decreases the longevity of the machinery.

    Safety Dangers: Unmanaged vibration might present significant safety concerns to both the machinery and the workers. In, extreme situations, such vibrations might lead to disastrous equipment failure, jeopardizing personnel along with causing considerable devastation across the premises.

    Exactness along with Quality Problems: In fields that require precise production, such as manufacturing and space industry, resonance may cause errors in the manufacturing process, producing flawed products and increased waste.

    Economical Alternatives to Oscillation Control

    Investing in resonance control systems proves not just a necessity and a sound investment for any business any business involved with machinery. The offered modern vibration control systems are built to remove oscillation in various equipment or rotational systems, providing uninterrupted along with efficient operations.

    What distinguishes our apparatus apart is its economic value. It is recognized that the value of keeping costs low in the modern competitive marketplace, which is why we offer high-quality vibration regulation systems at prices that won’t break the bank.

    Through selecting our offerings, you aren’t simply protecting your machinery as well as boosting its operational effectiveness you’re also putting resources towards the long-term performance of your business.

    Final Thoughts

    Oscillation control proves to be an essential factor of maintaining the efficiency, protection, along with longevity of your industrial equipment. Through our cost-effective oscillation control systems, you can ensure your processes function efficiently, your products maintain high quality, and your workers remain safe. Do not let oscillation jeopardize your machinery—invest in the right equipment now.

  14. Xazryxq说道:

    Привет, друзья!
    Приобрести документ ВУЗа.
    borovsk-tract.maxbb.ru/posting.php?mode=post&f=1

  15. Sazresm说道:

    Быстрое обучение и получение диплома магистра – возможно ли это?
    lms.bbwsmesujisekampung.com/blog/index.php?entryid=14749

  16. Sazruxm说道:

    Приобретение школьного аттестата с официальным упрощенным обучением в Москве
    newcoop.ru/company/personal/user/816/blog/649

  17. Sazrute说道:

    Как быстро и легально купить аттестат 11 класса в Москве
    spurstartup.mn.co/posts/65295398

  18. Lazrshr说道:

    Привет, друзья!
    Мы изготавливаем дипломы любой профессии по невысоким тарифам.
    boi.instgame.pro/forum/index.php?topic=24392.0

  19. Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт бытовой техники

  20. Cazryhr说道:

    Привет, друзья!
    Заказать диплом о высшем образовании
    купить диплом в кызыле

  21. Cazrqzn说道:

    Здравствуйте!
    Заказать диплом о высшем образовании
    купить дипломы о высшем

  22. Cazrpex说道:

    Привет!
    Получить диплом ВУЗа
    купить диплом железнодорожника

  23. Cazrizh说道:

    Добрый день!
    Заказать диплом академии
    купить диплом в дербенте

  24. Cazrscq说道:

    Добрый день!
    Получить диплом о высшем образовании
    купить диплом кандидата наук

  25. Cazrsfq说道:

    Добрый день!
    Купить диплом о высшем образовании
    купить диплом университета

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注