#rubyonrails - Sat 31 Mar 2007 between 06:19 and 06:22

NY Lost Funds



PalishUmm...
AshimsI sure as hell know SQL :)
PalishOkay.. Well, before I get into that, Ashims's IN sounded interesting
so getting that right..
given a user_id and a classroom_id, determine if a user is in a classroom, by being linked through a section to a classroom
Ashims: so student_entries { user_id, section_id } sections { classroom_id }
Ashimsif it doesn't work Palish, I'll look up the right syntax-- a little drunk right now ;).
BigFischlol
Anyone have any luck w/ the thread I posted?
AshimsBigFisch== will get to yours in a sec ;)
ReinHUser belongs_to :section belongs_to classroom?
BigFischAshims: yay
ReinH{} is valid SQL?? o.O
AshimsReinH: Subqueries.
ReinHah
thought that was ()
AshimsReinH: best.thing.ever
baha!
actionReinH shrugs
ReinHshrugs
Ashimsshhh... I'm drinking-- as I say.
PalishSELECT * FROM student_entries WHERE { SELECT * FROM sections WHERE id = student_entries.section_id }.classroom_id = my_classroom_id
ReinH:p
Palishthat's the ideal made up syntax I just thought
of
ReinHPalish: stop writing SQL in rails!
Ashimsyou need a condition Palish
WHERE something IN something
ReinHStop teaching people to write SQL in ralis!
*rails
Palish: Student belongs_to section belongs_to classroom?
AshimsReinH: I'm not! I'm teaching people to write SQL.
BigFischlol
ReinHAshims: in #rubyonrails!
Ashimsokay Palish.. listen to the sobre man
PalishSo.. SELECT * FROM student_entries WHERE my_classroom_id IN { SELECT * FROM sections WHERE id = student_entries.section_id } ?
ReinHheheh :)
Palish: NO! lol, no SQL
AshimsReinH: dun care where it is-- someone asks about SQL, I'll tell em!
ReinHPalish: what are your associations
PalishSeriously, I want to get the SQL right, I need to learn it

Page: 1 8 15 22 29 36 43 50 57 64 71 78 

IrcArchive

NY Lost Funds