sql update

6 Sep 2015,
Share: 

sql update เป็นคําสั่งที่ใช้สําหรับแก้ไขข้อมูลในตาราง สามารถแก้ไขข้อมูลได้หลาย Field และหลาย Record โดยจะขึ้นอยู่กับ Where ที่ผู้ใช้กําหนด

Database support

MySQL,Microsoft Access,SQL Server,Oracle

รูปแบบการใช้

UPDATE [Table-Name] SET Column1='Value1',Column2='Value2',... WHERE clause

parameter

  • [Table-Name] คือ ชื่อของตารางที่ต้องการ
  • clause คือ เงื่อนไขที่ต้องการ
  • Column1=‘Value1’,Column2=‘Value2’,… คือ Column ที่ต้องการแก้ไข

Example

Table : country

CountryCode

CountryName

TH

Thailand

EN

English

US

United states

CH

Chaina

เมื่อต้องการแก้ไขข้อมูล CountryCode = ‘JP’,CountryName=‘Japan’ ใน Record CountryCode=‘CH’

UPDATE country SET CountryCode = 'JP',CountryName='Japan' WHERE CountryCode = 'CH'

Output:

CountryCode

CountryName

TH

Thailand

EN

English

US

United states

JP

Japan

ข้อมูลจาก thaicreate

Suggestion blogs

การใช้งานคำสั่ง git status

สวัสดีครับ บทความนี้จะมีเนื้อหาการใช้งานคําสั่ง git status เพื่อจะดู Status ของ file ต่างๆ ที่อยุ่ใน Repository ครับ

Delegate คืออะไร และใช้งานอย่างไร

Delegate คืออะไรDelegate จะเก็บตําแหน่ง Address ของ Method ที่ต้องการจะเรียกใช้ ทําให้เราสามารถเรียกใช้ Method ใดๆ ผ่าน Delegate ได้ คุณอาจจะสงสัยว่า ทําไมไม่เรียกใช้ Function ตรงๆไปเลย ข้อดีของการเรียกผ่าน Delegate คือสามารถเรียก Mathod ของ Class อื่นได้

Raspberry pi connect wifi network โดยไม่ต้องต่อจอภาพ

เราสามารถ Setting ให้ Raspbbery Pi ของเราเชื่อมต่อกับ Wifi network ได้โดยไม่ต้องต่อกับ จอภาพ, เมาส์ และคีย์บอร์ด เลย ซึ่งจะสะดวกมากสําหรับใครที่จะนํา Raspberry Pi ไปใช้งานในลักษณะที่ไม่ต้องใช้จอภาพ


Copyright © 2019 - 2025 thiti.dev |  v1.58.0 |  Privacy policy | 

Build with ❤️ and Astro.

Github profile   Linkedin profile   Instagram   X profile   Nostr   Youtube channel   Telegram   Email contact   วงแหวนเว็บ