Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tampasounds
Starting Member
6 Posts |
Posted - 2007-05-13 : 23:53:06
|
| Hi all, have a pretty simple query. but am new to workin in multiple tables. This statement shows Items in table1 that exists in table2 that match a filter.I would like to change this query to update the TOBEDELETED column to 'F' based on the same column and filter match. SELECT ITEMS.ITEMNO, ITEMS.TOBEDELETED FROM ITEMSINNER JOIN QLOGON ITEMS.ITEMNO=QLOG.SOURCEIDWHERE QLOG.SOURCE= 'ITEMS'Thanks all in advance |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-13 : 23:57:34
|
[code]UPDATE iSET TOBEDELETED = 'F'SELECT ITEMS.ITEMNO, ITEMS.TOBEDELETEDFROM ITEMS iINNER JOIN QLOG qON i.ITEMNO=q.SOURCEIDWHERE q.SOURCE= 'ITEMS'[/code] KH |
 |
|
|
tampasounds
Starting Member
6 Posts |
Posted - 2007-05-14 : 00:08:00
|
| HI THANKS, Server: Msg 107, Level 16, State 3, Line 1The column prefix 'QLOG' does not match with a table name or alias name used in the query.Server: Msg 107, Level 16, State 1, Line 1The column prefix 'ITEMS' does not match with a table name or alias name used in the query.Server: Msg 107, Level 16, State 1, Line 1The column prefix 'QLOG' does not match with a table name or alias name used in the query. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-14 : 00:11:08
|
Sorry forgot to changed the table reference. I have amended the query. KH |
 |
|
|
tampasounds
Starting Member
6 Posts |
Posted - 2007-05-14 : 00:14:07
|
| That did the trick! Thanks so much! |
 |
|
|
|
|
|
|
|