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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help to execute the below query

Author  Topic 

tsaliki
Starting Member

19 Posts

Posted - 2012-11-02 : 03:12:37
I have a table with records as follows:


select * from jobidstable


Insert into jobidstable values('1,2,3')

Insert into jobidstable values('1,4,7')

Insert into jobidstable values('2,5,6')

Insert into jobidstable values('3,4,5')


Now for example for AutoId 1 the jobIDS are '1,2,3' i want to update those ids to '1,5,7' i.e if there are records already then those records must be present along with the updated records i.e now my output must be '1,2,3,5,7' for the autoid 1.

my output should be like below if i write the above query:

select * from jobidstable where autoid=1

output table:

autoid jobIDS

1 1,2,3,5,7



Thankyou

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-11-02 : 03:19:51
please post your table schema, sample data and the required result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-11-03 : 21:54:24
which table has autoid? also why are you storing values as csv in table column? have you heard about normalisation?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -