stuck and i need a mysql clue

View: New views
4 Messages — Rating Filter:   Alert me  

stuck and i need a mysql clue

by Erik Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


How would I exclude NULL values from the author, title, or isbn fields  
in the query.

SELECT b.biblionumber, b.author, b.title, SUBSTR(i.isbn,1,10)
FROM biblio b, biblioitems i
WHERE b.biblionumber = i.biblionumber;


I know it should be easy, but I'm not having much luck.
_______________________________________________
Koha mailing list
Koha@...
http://lists.katipo.co.nz/mailman/listinfo/koha

Re: stuck and i need a mysql clue

by Emrys Minnig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use IS NOT NULL in your WHERE statement.   For example:
 
SELECT * FROM biblio WHERE title = "Slaughterhouse Five" AND isbn IS NOT NULL.
 
Emrys

________________________________

From: koha-bounces@... on behalf of Erik Lewis
Sent: Tue 03/11/2009 16:00
To: koha@...
Subject: [Koha] stuck and i need a mysql clue




How would I exclude NULL values from the author, title, or isbn fields
in the query.

SELECT b.biblionumber, b.author, b.title, SUBSTR(i.isbn,1,10)
FROM biblio b, biblioitems i
WHERE b.biblionumber = i.biblionumber;


I know it should be easy, but I'm not having much luck.
_______________________________________________
Koha mailing list
Koha@...
http://lists.katipo.co.nz/mailman/listinfo/koha


_______________________________________________
Koha mailing list
Koha@...
http://lists.katipo.co.nz/mailman/listinfo/koha

Re: stuck and i need a mysql clue

by Erik Lewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Exactly the clue in I needed.

Thanks

SELECT b.biblionumber, b.author, b.title, SUBSTR(i.isbn,1,10) 
FROM biblio b, biblioitems i 
WHERE (b.biblionumber = i.biblionumber AND i.biblionumber IS NOT NULL) 
AND (b.author IS NOT NULL) AND (b.title IS NOT NULL);



On Nov 3, 2009, at 11:13 AM, Emrys Minnig wrote:

Use IS NOT NULL in your WHERE statement.   For example:

SELECT * FROM biblio WHERE title = "Slaughterhouse Five" AND isbn IS NOT NULL.

Emrys

________________________________

From: koha-bounces@... on behalf of Erik Lewis
Sent: Tue 03/11/2009 16:00
To: koha@...
Subject: [Koha] stuck and i need a mysql clue




How would I exclude NULL values from the author, title, or isbn fields
in the query.

SELECT b.biblionumber, b.author, b.title, SUBSTR(i.isbn,1,10)
FROM biblio b, biblioitems i
WHERE b.biblionumber = i.biblionumber;


I know it should be easy, but I'm not having much luck.
_______________________________________________
Koha mailing list
Koha@...
http://lists.katipo.co.nz/mailman/listinfo/koha



_______________________________________________
Koha mailing list
Koha@...
http://lists.katipo.co.nz/mailman/listinfo/koha

Re: stuck and i need a mysql clue

by Nicole Engard-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

And the broken record -- make sure you share what you learn on the
Koha wiki SQL Report Library:
http://wiki.koha.org/doku.php?id=sql_library

Thanks
Nicole Engard
Documentation Manager

2009/11/3 Erik Lewis <elewis@...>:

> Exactly the clue in I needed.
> Thanks
> SELECT b.biblionumber, b.author, b.title, SUBSTR(i.isbn,1,10)
> FROM biblio b, biblioitems i
> WHERE (b.biblionumber = i.biblionumber AND i.biblionumber IS NOT NULL)
> AND (b.author IS NOT NULL) AND (b.title IS NOT NULL);
>
>
> On Nov 3, 2009, at 11:13 AM, Emrys Minnig wrote:
>
> Use IS NOT NULL in your WHERE statement.   For example:
>
> SELECT * FROM biblio WHERE title = "Slaughterhouse Five" AND isbn IS NOT
> NULL.
>
> Emrys
>
> ________________________________
>
> From: koha-bounces@... on behalf of Erik Lewis
> Sent: Tue 03/11/2009 16:00
> To: koha@...
> Subject: [Koha] stuck and i need a mysql clue
>
>
>
>
> How would I exclude NULL values from the author, title, or isbn fields
> in the query.
>
> SELECT b.biblionumber, b.author, b.title, SUBSTR(i.isbn,1,10)
> FROM biblio b, biblioitems i
> WHERE b.biblionumber = i.biblionumber;
>
>
> I know it should be easy, but I'm not having much luck.
> _______________________________________________
> Koha mailing list
> Koha@...
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
>
>
> _______________________________________________
> Koha mailing list
> Koha@...
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
>
_______________________________________________
Koha mailing list
Koha@...
http://lists.katipo.co.nz/mailman/listinfo/koha