Today I bring a question about How to make a query?
It turns out that I have a table called x, which has 3 or more records (ID, MAC, DATE_CREATION).
Now I want to make a SELECT which selects a range of dates eg
SELECT
ID, MAC, FECHA_CREACION
FROM x
WHERE
FECHA_CREACION BETWEEN 'ayer (00-00-00)' and 'hoy (00-00-00)'
Result:
<table border='0'>
<tr>
<td>1</td>
<td>bcc810139fc0</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>2</td>
<td>ac202e43ef20</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>3</td>
<td>ac202e444e20</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>4</td>
<td>bcc810139fc0</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>5</td>
<td>ac202e43ef20</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>6</td>
<td>ac202e444e20</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>7</td>
<td>bcc810139fc0</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>8</td>
<td>bcc810139fc0</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>9</td>
<td>ac202e43ef20</td>
<td>2018-10-24 08:35:13</td>
<tr>
<tr>
<td>10</td>
<td>bcc810139fc0</td>
<td>2018-10-25 08:35:13</td>
<tr>
<tr>
<td>11</td>
<td>ac202e444e20</td>
<td>2018-10-25 08:35:13</td>
<tr>
</table>
And everything works very well, but now imagine that the range of dates I have several MACs equal (if possible, for the idea I develop), then there goes my question How do I make a query which if it finds several MAC same in that range of dates, show the last one entered (DATE_CREATION)?
Thank you very much.