Hi,
In MSQL you can do it a little dirty, create a table with rows with numbers where you want to match against (1, 2, 3, 4, 5, etc) Then do a JOIN WHERE NOT a=b; It's not a very nice one, and I don't know if it works for mySQL too. Greetinx Michaël Hompus "Jamie Burns" <jamie.burns@dynamicexpress To: "sherzodR" <[EMAIL PROTECTED]> ion.co.uk> cc: <[EMAIL PROTECTED]> Subject: Re: can i do this with sql? 27-11-2001 14:28 i actually need the id's with no row returned as if they were there (but with default values)... they do not need to be inserted into the table, just returned as if they were in there. j ----- Original Message ----- From: "sherzodR" <[EMAIL PROTECTED]> To: "Jamie Burns" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, November 27, 2001 1:24 PM Subject: Re: can i do this with sql? > > > 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 --------------------------------------------------------------------- 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