Friday, 15 March 2013

sql - SQLite Query for rows where value may exist? -



sql - SQLite Query for rows where value may exist? -

i have table has next columns: id, session_id, date_start, date_end, speaker_1, speaker_2, speaker_3, speaker_4, speaker_5

i'd query table sessions speaker_id contained in of 5 speaker columns. i'm needing bring together table session_id contains additional info session.

i know table construction isn't in ideal format want do, can't table construction changed @ point.

i'm curious how query conditional portion of speaker value @ end. possible grouping columns?

basic sql experience here. thanks!

you can utilize in:

select s.* speakers s 1 in (speaker_1, speaker_2, speaker_3, speaker_4, speaker_5);

(assuming looking 1 speaker id.)

you can utilize variables in in list.

sql sqlite

No comments:

Post a Comment