*** jcater has quit IRC *** btami has joined #gnuenterprise *** reinhard has joined #gnuenterprise *** kilo has joined #gnuenterprise *** johannesV has joined #gnuenterprise good morning Morning good morning *** kilo has quit IRC *** reinhard has quit IRC *** Poincare has quit IRC *** lupo__ has quit IRC *** kilo has joined #gnuenterprise *** reinhard has joined #gnuenterprise *** Poincare has joined #gnuenterprise *** lupo__ has joined #gnuenterprise *** nickr has quit IRC *** btami has quit IRC *** dimas has quit IRC *** chillywilly has quit IRC *** nickr has joined #gnuenterprise *** btami has joined #gnuenterprise *** dimas has joined #gnuenterprise *** chillywilly has joined #gnuenterprise *** nickr has quit IRC *** derek has joined #gnuenterprise *** deke has quit IRC *** nickr has joined #gnuenterprise *** jamest has joined #gnuenterprise *** kilo has quit IRC *** btami has quit IRC *** reinhard has quit IRC *** reinhard has joined #gnuenterprise *** reinhard has quit IRC *** jcater has joined #gnuenterprise *** Morphous_ has joined #gnuenterprise *** Morphous has quit IRC *** johannesV has quit IRC *** sjc has joined #gnuenterprise *** deke has joined #gnuenterprise *** derek has quit IRC *** jamest has quit IRC *** jamest has joined #gnuenterprise *** jamest has quit IRC *** deke is now known as derek *** jfincher has joined #gnuenterprise Let's say I want to get a value from the database when no rows match a particular WHERE clause -- how can I best do that? can you elaborate? Let's say I have a table of file ids and file names, and I want the file id if a file is in the table, and -1 if it's not. (yes, it's contrived) select id from (select id from table where name = 'filename' UNION ALL select -1) order by id desc limit 1 is a quick way in postgres assuming ids are positive or you couild do select id from table where name = 'filename' union all select -1 where not exists (select 1 from table where name = 'filename') which makes no assumptions jcater: awesome, thanks. np *** jamest has joined #gnuenterprise *** jamest_ has joined #gnuenterprise *** jamest_ has quit IRC *** sjc has quit IRC *** jamest has quit IRC *** jamest has joined #gnuenterprise *** jamest has quit IRC *** jcater has quit IRC