![]() ![]() So I can see why someone might think they need to know the pseudokey, but they are incorrect. Seems to me that there is no need to EVER deal with the pseudokeys. ![]() ![]() (select house_id from houses where address = new.address) Select (select name_id from names where name = new.name), INSERT INTO PaymentInformation(NAME, Start, End) VALUES('Tina','','') WHERE NOT EXISTS ( SELECT FROM PaymentInformation WHERE name 'Tina' AND durationstart '' ) Is this how it should be done It shouldn't insert if Tina is already in the table with a Start day of. Insert or ignore into houses (address) select new.address where new.address is not null Insert or ignore into names (name) values (new.name) Note that if the ID field is set to autoincrement, then the IDs. Select raise(ABORT, 'Name cannot be NULL') where new.name is null You can do this with a unique constraint & insert or ignore. Where (peasants.name_id is null or peasants.name_id = names.name_id)Īnd (peasants.house_id is null or peasants.house_id = houses.house_id) Ĭreate trigger ins_person instead of insert into persons It is actually not needed for anything at all.Īddress text not null collate nocase unique either a pre-defined SQLite database to be opened, or if the file doesnt exist. It also does not really matter what some excrement-head thinks "after the fact" - they can either accept the answer "I don't know" (which by the way is an incorrect answer - the correct answer would be "that information was not recorded").Īnd going back to the post to which you replied, it only appears to the uneducated that there is a need to know the pseudokey for the row. Load a Tables.jl input source into an SQLite table that will be named. Playing with pseudokeys will not be helpful in this regard. INSERT INTO table1 (email) SELECT email FROM ( SELECT '' AS email ) AS o WHERE NOT EXISTS ( SELECT FROM table1 WHERE email o.email ) The former is much shorter and staightforward while the latter is much longer and slower, but is standard SQL that should work unchanged on all SQL platforms since about 1985. Unless the inserted record contains a timestamp of when it was inserted, there is no way to tell when the record was inserted. Well, that is a design flaw (failure to store needed information) and has nothing whatsoever to do with the question asked. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |