SQL how to update left joined tables?

UPDATE alldistros SET name="CatMan" WHERE name = "Absolute Linux I think you're getting the concept of tables and queries mixed up.

UPDATE alldistros SET name="CatMan" WHERE name = "Absolute Linux" I think you're getting the concept of tables and queries mixed up.

But you see there are 'name' fields in more than one table in my database. And the name "absolute Lunux" can be in any one of the 3tables. Thats why I joined them in the first place.

– mrbunyrabit Nov 23 at 19:01 In this particular case, since all of the names are the same, you can just apply the above query six times, one for each table. – Godwin Nov 23 at 19:06 ahhhhhhhhhhh Thats kinda clever..... oky kwl, im gona try that, thanx. Will let you know how it went – mrbunyrabit Nov 23 at 19:08 your method worked, thank you.

I just updated every table in one go. Thank yoU! – mrbunyrabit Nov 25 at 16:37 Great to hear!

Want top mark this question as answered then? – Godwin Nov 25 at 19:08.

UPDATE alldistros SET name = "CatMan" from alldistros t1 LEFT join origin t2 on t1. Name=t2.Name LEFT join desktop t3 on t2. Name=t3.

Name LEFT join beginnerdistributions t4 on t3.Name=t4. Name LEFT join oldcomputers t5 on t4. Name=t5.Name LEFT join multimedia t6 on t5.

Name=t6. Name WHERE t1.Name = 'Absolute LInux' Maybe I am mis-reading the question, did you want to update all table's name column where the name is what you are looking for?

Ive tried this, but theres an error in that statement. And ive tried writing "catman" like 'catman' But still an error – mrbunyrabit Nov 24 at 14:38 I know this is old but what was the error you were seeing? – szeliga 2 days ago it said "Syntax error near from" =) – mrbunyrabit 2 days ago.

It looks like you're using name as foreign key in all your tables (and primary key in alldistros). You'll have to disable foreign key constrant check do the updates to all tables enable constraint check all this one in transaction. Better yet, create another, non-updatable primary key column on alldistros (and foreign key column on all other tables).

For example make it integer and call it "distro_id" and do the join on that column. Since distro_id will be internal to your database, you won't have to worry about updates. Edit: And IF you don't have a foreing key/primary key constraint then you probably should put it there.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions