Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql query error for timestamps
    text
    copied!<p>I hope the below error is self explanatory.I want to compare event_time with some few cart_time.I know that usually when we want any operation like this we need to use <code>in</code> but for timestamps how to compare it</p> <pre><code> mysql&gt; SELECT bsid FROM access_aug15 WHERE event_time &lt; (SELECT cart_time FROM chat_final WHERE bsid in (SELECT bsid FROM access_aug15 WHERE eventid="11" AND current_page not like '%cart%')); ERROR 1242 (21000): Subquery returns more than 1 row </code></pre> <p>EDIT:Table structure access_aug15</p> <pre><code> +-------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------+--------------+------+-----+---------+-------+ | vid | varchar(200) | YES | | NULL | | | bsid | varchar(200) | YES | MUL | NULL | | | event_time | datetime | YES | MUL | NULL | | | eventid | varchar(10) | YES | MUL | NULL | | | current_page | mediumtext | YES | | NULL | | | departmentid | varchar(100) | YES | MUL | NULL | | | form_id | varchar(100) | YES | | NULL | | | form_name | varchar(100) | YES | | NULL | | | page_title | varchar(200) | YES | | NULL | | | report_date | datetime | YES | MUL | NULL | | +-------------------+--------------+------+-----+---------+-------+ </code></pre> <p>table2:chat_final</p> <pre><code> +-------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------+--------------+------+-----+---------+-------+ | bsid | varchar(200) | YES | MUL | NULL | | | chat_time | datetime | YES | | NULL | | | cart_time | datetime | YES | | NULL | | | customerid | varchar(100) | YES | | NULL | | | detail | longtext | YES | | NULL | | | chat_type | varchar(5) | YES | | NULL | | +-------------------+--------------+------+-----+---------+-------+ </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload