Mahalakshmi.m wrote:
> 
> "CREATE TABLE ARTIST (ArtistId INTEGER PRIMARY KEY NOT NULL,ArtistName TEXT
> NOT NULL COLLATE NOCASE ,YomiArtistName TEXT NOT NULL,UNIQUE(ArtistName));"
> 
> ArtistId              ArtistName              YomiArtistName  
> 10                    bbb                     BBB
> 11                    xxx                     XXX
> 12                    aaa                     AAA
> 
> "CREATE TABLE ALBUM (AlbumId INTEGER PRIMARY KEY NOT NULL,AlbumName TEXT NOT
> NULL COLLATE NOCASE ,YomiAlbumName TEXT NOT NULL,UNIQUE(AlbumName));"
> 
> AlbumId               AlbumName               YomiAlbumName
> 20                    zzz                     ZZZ
> 21                    ccc                     CCC
> 22                    bbb                     BBB
>                                       
> "CREATE TABLE MUSIC(Id INTEGER PRIMARY KEY NOT NULL,Track TEXT NOT
> NULL,YomiTrack TEXT NOT NULL,URL TEXT NOT NULL,Album_Id INTEGER,Artist_Id
> INTEGER,AlbumArtist_Id INTEGER);"
> 
> Id Track      YomiTrack       URL       Album_Id      Artist_Id
> AlbumArtist_Id
> 1  trak1      TRAK1     c:/trak1      22       10               1
> 2  song       SONG      c:/song               21       11               2
> 3  abc        ABC       c:/abc                23       12               3
> 
> Now I want to Update the AlbumName or ArtistName for all the records in
> MUSIC table . How can I do.If I update All the Records to one New AlbumName
> Then the rest of the AlbumName should be deleted.
> 

If you want to update the AlbumName field, you must do that with an 
update statement running on the Album table, not the Music table, since 
that is where the AlbumName field is stored. You haven't said what you 
want to update the AlbumName or ArtistName to. You probably have a 
condition, that you also haven't described, that selects which records 
in the table to update. Generally it will look something like this.

update Album
set AlbumName = (select some_value using music table....)
where AlbumId in (select some records using the music table ....);

If this isn't what you are looking for, you will have to describe your 
problem in more detail (i.e. what you are trying to do, an example of 
before and after data, etc.) before anyone can provide more assistance.

HTH
Dennis Cote
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to