sqlite - How to know if a row doesn't exist? -


I have the following query:

  Select row 1 by Random () Limit 1  

Also I have another table (Table 3). In that table I have the column table 1_id and the table 2_id is a link of one line in the table 1_id table 1 and the table 2_id is a link of one line in the second table.

I want to achieve only those results in my query that are defined in Table 3. Only those who have table 1 queued in their table 1_id column There can not be any column in the context of a fixed table 1 row, so in this situation I do not want to receive them.

How can I achieve this goal?

Update: I tried the following question, which does not work:

  Select 1 line from the table, line it in row 1 (Table 1_id to Table 3 Where the table select 1_id = table1.rowid) Random () range 1)  

  Select from 1 row in the table where in the queue (choose from Table 3 Table 1_id); Random () range 1 by command;  

This query means "Choose from a random one line from" table1 "which is the entry table3 " ".

Each row is being selected in Table 1 ( DISTINCT ), as long as it has at least one in table3 The time is referred to.

If you are trying to get more than one result, you would get " from command to random () range 1 " section.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -