|
April 2, 2010, 04:29 PM
|
|
Banned
|
|
Join Date: February 25, 2006
Location: London, UK
Favorite Player: Only Ashraful & Me
Posts: 4,428
|
|
SQL query help
What would be the query for this :-
" Produce a list of all books having the same title. The list should include the title, ISBN, year of publication, type of binding and the language of the book."
|
April 2, 2010, 04:53 PM
|
|
Super Moderator BC Editorial Team
|
|
Join Date: February 12, 2004
Location: Canada
Favorite Player: Ice Man, Chatter Box
Posts: 27,678
|
|
SELECT title, ISBN, yearOfPublication, typeOfBinding, language FROM Books ORDER BY title
...assuming the name of your table is "Books". Alternatively you can use GROUP BY (as opposed to ORDER BY). Is that what you're looking for?
__________________
Screw the IPL, I'm going to the MLC!
|
April 2, 2010, 05:10 PM
|
|
Super Moderator BC Editorial Team
|
|
Join Date: February 12, 2004
Location: Canada
Favorite Player: Ice Man, Chatter Box
Posts: 27,678
|
|
In fact, a better way to do this might be:
SELECT title, ISBN, yearOfPublication, typeOfBinding, language FROM Books WHERE title in (SELECT title FROM Books GROUP BY title HAVING (COUNT(title) > 1))
...assuming you're looking for duplicates.
__________________
Screw the IPL, I'm going to the MLC!
|
April 2, 2010, 07:19 PM
|
|
Banned
|
|
Join Date: February 25, 2006
Location: London, UK
Favorite Player: Only Ashraful & Me
Posts: 4,428
|
|
Quote:
Originally Posted by AsifTheManRahman
In fact, a better way to do this might be:
SELECT title, ISBN, yearOfPublication, typeOfBinding, language FROM Books WHERE title in (SELECT title FROM Books GROUP BY title HAVING (COUNT(title) > 1))
...assuming you're looking for duplicates.
|
Yay, Its work.
Thanks a lot Asif vai.
|
April 2, 2010, 07:55 PM
|
|
Banned
|
|
Join Date: February 25, 2006
Location: London, UK
Favorite Player: Only Ashraful & Me
Posts: 4,428
|
|
One more:
How will I count multiple column from same table?
For instance,
Library item can be borrowed under borrowing category of short loan and ordinary loan. How would I produce a list of all library item under that category. And output will be the name of category and total number of item.
So, I have the table name "Borrowing_catg". This are the four collumn: b_catg_id, Shortloan_id, ordinaryL_id and library_item.
|
April 2, 2010, 08:05 PM
|
Administrator
|
|
Join Date: January 22, 2004
Posts: 22,100
|
|
Omio - how much of the homework done?
^^ do a join
|
April 2, 2010, 08:13 PM
|
|
Cricket Legend
|
|
Join Date: July 25, 2002
Favorite Player: Tamim, Riyad, Ashraful
Posts: 5,835
|
|
Omio got a outsourcing project from a financially struggling library in India?
|
April 2, 2010, 08:22 PM
|
|
Banned
|
|
Join Date: February 25, 2006
Location: London, UK
Favorite Player: Only Ashraful & Me
Posts: 4,428
|
|
Quote:
Originally Posted by Zunaid
Omio - how much of the homework done?
^^ do a join
|
Lol, 50% done. Asif vai is real tiger.
|
April 2, 2010, 08:22 PM
|
|
Banned
|
|
Join Date: February 25, 2006
Location: London, UK
Favorite Player: Only Ashraful & Me
Posts: 4,428
|
|
Quote:
Originally Posted by Orpheus
Omio got a outsourcing project from a financially struggling library in India?
|
hahahaha
|
April 2, 2010, 10:34 PM
|
|
Cricket Guru
|
|
Join Date: September 3, 2006
Location: Mississauga, Ontario
Favorite Player: Sakib - the real Tiger
Posts: 11,194
|
|
Wasn't Omio banned?
What's the update query for unbanning?
Good to have you back bro.
__________________
cricket is a PROCESS, not an EVENT or two. -- Sohel_NR
Fans need to stop DUI (Dreaming Under Influence)!
|
April 3, 2010, 04:51 AM
|
|
Banned
|
|
Join Date: February 25, 2006
Location: London, UK
Favorite Player: Only Ashraful & Me
Posts: 4,428
|
|
Quote:
Originally Posted by Kabir
Wasn't Omio banned?
What's the update query for unbanning?
Good to have you back bro.
|
Thanks Kabir vai .
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT -5. The time now is 04:43 PM.
|
|