UPDATE JOIN бичих нь: MsSQL, MySQL, pgSQL

Хааяа UPDATE JOIN хийх хэрэгцээ гардаг. Заримдаа хэрхэн бичихээ мартчих юм. T-SQL-ийн хувьд хэд хэдэн арга бий, гэхдээ би доор бичсэн хувилбарыг ашиглаад сурчихсан.

T-SQL

UPDATE blog_tagging AS bt
	SET bt.tag = t.tag_name
	FROM tbl_tags AS t
	WHERE bt.tag_id = t.tag_id

MySQL

UPDATE blog_tagging AS bt
	LEFT JOIN tbl_tags AS t ON bt.tag_id = t.tag_id
	SET bt.tag = t.tag_name

pgSQL

UPDATE blog_tagging bt
	SET tag= t.tag_name
	FROM tbl_tags t
	WHERE bt.tag = t.tag_name

ЖИЧ: pgSQL UPDATE JOIN нэмэв.

Advertisements

About Сайнбаяр
Web Developer.

One Response to UPDATE JOIN бичих нь: MsSQL, MySQL, pgSQL

  1. I really like your blog.. very nice colors & theme.
    Did you make this website yourself or did you

    hire someone to do it for you? Plz answer back as I’m looking to design my own blog and

    would like to know where u got this from. many

    thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: