Displaying 3 results from an estimated 3 matches for "charge_id_number".
2006 Jul 14
3
compare two tables and find the difference?
...exist in TableB.
TableA and TableB are different but do have one field in common that i
am comparing. The tables are not related in anyway.
right now I have a find_by_sql query located in a model that looks like
this:
def self.absent_charges
find_by_sql <<-QUERY
SELECT sources.charge_id_number, sources.charge_name,
sources.offense_level
FROM sources
LEFT JOIN charges ON sources.charge_id_number =
charges.charge_id_number
WHERE charges.id IS NULL
QUERY
end
I also need to dedupe what ends up in my final collection after the
find_by_sql query, but I am no...
2006 Jul 17
0
collection_select help
...ng? any suggestions? I have
also tried: <%= collection_select "charge", "offense_level",
@charge_types, :id, :full_name %> but that doesn''t work either.
@charges contains multiple records obtained from a find_by_sql query.
each record has 3 fields: charge_name, charge_id_number, offense_level
@charge_type.id should be equal to the @charge.offense_level
the view - update_charges.rhtml:
<h2>Add missing records to charges table</h2>
<%= start_form_tag %>
<table>
<th>Charge id number</th>
<th>Charge name</th>
<th>...
2006 Jul 21
0
[Slightly OT] Need Query Help
...0
end
create_table "charges", :force => true do |t|
t.column "charge_type_id", :integer, :limit => 10, :default => 0,
:null => false
t.column "name", :string, :limit => 100, :default => "", :null =>
false
t.column "charge_id_number", :string, :limit => 15, :default => "",
:null => false
end
add_index "charges", ["charge_type_id"], :name => "charges_FKIndex2"
create_table "clients", :force => true do |t|
t.column "person_id", :string,...