Linked Questions

437 votes
2 answers
989k views

SQL Server - inner join when updating [duplicate]

I have the below query which does not work. What am I doing wrong? Is this even possible? UPDATE ProductReviews AS R INNER JOIN products AS P ON R.pid = P.id SET R.status = '0' WHERE R....
LeeTee's user avatar
  • 6,461
6 votes
1 answer
12k views

SQL Server Update Using Multiple Tables [duplicate]

I don't know much about SQL - I'm just writing an RFID student registration scanner that interfaces to a database in SQL Server. I'm sure this is quite easy to do but I could not find a solution for ...
Richard Pearce's user avatar
0 votes
1 answer
2k views

Incorrect syntax near the keyword 'AS'. in SQL Server [duplicate]

I have problem with my SQL Server query: UPDATE latihan AS t1 , (SELECT Equipment, system_status, functloc FROM latihan WHERE system_status='ESTO') AS t2 SET t1.functloc = ...
Tri's user avatar
  • 25
1 vote
1 answer
417 views

Update with inner join [duplicate]

Possible Duplicate: Update a table using JOIN in SQL Server? I am stuck on a very simple query, an update with a join, I want to put the value of the field RECORDTYPE in the RECORDTYPE field = to ...
UnDiUdin's user avatar
  • 15.1k
1 vote
2 answers
2k views

Why am I getting an error in executing this statement in DB Browser for SQLite? [duplicate]

I am trying to execute this statement in DB Browser: UPDATE p SET SourceId = s.Id FROM Practice p INNER JOIN Source s ON p.Source = s.Name And it is refusing to execute complaining that says: ...
pthalacker's user avatar
  • 2,126
1 vote
2 answers
340 views

Update a table by using a join [duplicate]

I have two tables ta, tb. ta columns - cId, c1, c2. c1 and c2 contain nulls and need to be filled with data. tb columns - cId, c3, c4. The data for c1 and c2 will come from c3 and c4 respectively. So,...
Trojan.ZBOT's user avatar
  • 1,448
2 votes
1 answer
261 views

Update column from inner join [duplicate]

I have a table of posts from a forum, basically there is one row for the posting of a pdf file , then there is another row for the posting of the image url that goes with the pdf. So I took all the ...
Scott Selby's user avatar
  • 9,490
1 vote
2 answers
83 views

Sql Server 2008 Update column with a join [duplicate]

I have done a lot of updating with MySql and have read a lot of questions and answers on here, but for some reason haven't been able to get my code to work. I keep getting Err 42000 incorrect syntex ...
Joker327's user avatar
2 votes
1 answer
76 views

SQL Server UPDATING one table from values from another table [duplicate]

I am trying to update values from one table to another in SQL Server. I have 2 tables: tblBus and tblRB_ID. create table tblBus ( bus varchar (10) NOT NULL PRIMARY KEY, rb_id int FOREIGN KEY ...
LongLouis's user avatar
2 votes
1 answer
115 views

Need to update one column for records where another value is duplicative in SQL Server [duplicate]

I am VERY rusty with my SQL, it's been a few years, but I need to write a query to fix something in a table I have. There are erroneous duplicates where not every column is the same, but I know at ...
Jim G's user avatar
  • 51
1 vote
0 answers
99 views

SQL command to compare results is not working [duplicate]

I have the code on below working and bringing back the OEMPartNumber. My problem is the OEMSubNumber. AS you can see in the table I cannot match the OEMSubNumber like i did the in sql i got working. I ...
BigDX's user avatar
  • 3,529
1 vote
1 answer
74 views

SQL Update values from one table column to another [duplicate]

I have a simple select statement that identifies the rows I want to update. Basically i want to copy the vad_description to the vb_description and can't quite figure this out. Any Help would be ...
TowelsRus's user avatar
1 vote
1 answer
67 views

Update a specific rows and columns in SQL Server [duplicate]

Table1 column1 | column2 | column 3 ----------------------------- A | 100 | a B | 200 | b C | 300 | c Table2 column1 | column3 ----------------- A | aaa C |...
OhMikeGod's user avatar
  • 107
-1 votes
1 answer
80 views

SQL Server error: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or [duplicate]

I am getting the following error while running the query in SQL Server: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or Can ...
KIdutta97's user avatar
-1 votes
2 answers
48 views

Multiple Selects to update tblItems - INNER JOIN required? [duplicate]

I need to update the buyersAccountID in tblITEMS with the accountID of a winner who's boxNo in tblEntrants matches 'winner' in tblItems: TBLENTRANTS fileID boxNo accountID TBLITEMS fileID ...
mark davies's user avatar

15 30 50 per page
1
2 3 4 5