i belive you want..:

SELECT * FROM your_table WHERE id < 9 ORDER BY id LIMIT 9;

But when it comes to generating missing items... I'm not sure if
i got you right though, but they should exist. MySQL cannot
make the rows that do not exist



Jamie Burns wrote:

: Hi all,
:
: I have a table like this:
:
:     id    data    year
:
:     1      2        01
:     2      2        01
:     6      2        01
:     7      2        01
:     8      2        01
:     11    2        01
:
: What i want to be able to get is these results from an sql query (given that
: i want id's 1-9):
:
:     id    data    year
:
:     1       2        01
:     2       2        01
:     3       0        0
:     4       0        0
:     5       0        0
:     6       2        01
:     7       2        01
:     8       2        01
:     9       0        0
:
: Basically it has made up the rows with id's 3,4, 5 and 9 because they didnt
: exist in the table.
:
: Can anybody give me any clues how to achieve this?
:
: Thanks,
:
: Jamie Burns.
:
:
: ---------------------------------------------------------------------
: Before posting, please check:
:    http://www.mysql.com/manual.php   (the manual)
:    http://lists.mysql.com/           (the list archive)
:
: To request this thread, e-mail <[EMAIL PROTECTED]>
: To unsubscribe, e-mail <[EMAIL PROTECTED]>
: Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
:

-- 
sherzodR <[EMAIL PROTECTED]>
use CGI::Session;


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to