Jump to content

Kcarson

Members
  • Posts

    207
  • Joined

  • Last visited

Posts posted by Kcarson

  1. That sounds great, and I notice Skemcin that you, reluctantly I imagine, had to change the signature to include "Did you go through the tutorials yet?". Hopefully you can change it back soon enough, I rather enjoyed the "I just looked at your site and it looks like it looks like its supposed to look" :)

  2. jayeshp100, I just saw an example that might be of help to you for this problem if you still need it. I have not had the opportunity to try it out myself, but I thought I would tell you anyways. Here is the example:

    select *     from employee_tbl where rownum < 5; /* Only returns the top X rows */

    Here is your query with it already inserted:

    select sum(d.price), e.Title, d.dvd_idfrom dvd_rental d, dvd_details ewhere ORDER_DATE between '4-NOV-04' and '04-NOV-05' and e.dvd_id = d.dvd_id and rownum < 11group by d.dvd_id, e.titleorder by sum(d.price) desc

    Let me know if it works :)

  3. In the future socx, please post whatever attempts you have made at the queries thus far, rather than just asking for the solution. That way, we can help you understand where you are going wrong, and hopefully you will learn more at the same time. You got lucky that aspnetguy gave you all the answers, I would not have been so nice :) just kidding...well sort of. But all joking aside, the best way to learn is not to have people hand you answers but to allow us to help you troubleshoot your attempts (no matter how feeble they may be).In the meantime, you have your answers, please make sure you understand how the queries were made. Let us know if you have any other problems :)

  4. Good point. Suggestions can be put down on adding to the forum, but we don't need more admins, cause we don't need the features at the very instance. On another forum I go to, all the suggestions are gathered in one thread for people to post, and then the admins can go through it when they have time and collect ideas. Then they execute all the new features in one go when they're ready.

    Jonas,I think it might be a good idea for the moderators (you, Skemcin, and Chocolate570) to create a thread only viewable by moderators and admins that would list off the features people are requesting and that you feel are valid. I think the three of you are around here often enough that you can get a good feel of what is wanted, needed, possible, and just a good/bad idea. The thread could include a detailed description of what is requested, the pros and cons that have been pointed out, and a link to the actual thread where the suggestion was made. This would allow Kaijim and the other admin an opportunity to see what the masses want :) very quickly and know that the moderators (people he has already endowed some level of trust to) have already reviewed it.Or if there is a way to make the thread viewable but only allow moderators and admins to post, that woudl be nice as well, so that regular members could still see what the suggestions are, but the thread would not become overwhelmed with the back and forth posts.
  5. I agree with Paim, while I think what needs to happen is that the user who posts the initial question should write back when a solution suggested worked for them and make sure they specify which one. Also as Paim mentioned other people might have better methods to accomplish the same task, this is especially true with programming and web-design where you can accomplish the same task sometimes using HTML, XHTML, Javascript, PHP, ASP, ASP.net...I think you get the idea. Each has their own merits and usually people answering do not know all the intricacies of each one and therefore may suggest one when another is better, but that is why we have such a large membership, I imagine that between all of us, we should be able to sufficiently answer all questions.Thats just my 2 cents :)

  6. So you want to either use the query you wrote if the number is not in use, and if it is in use, assign a 1 to a separate field, correct?Also, what database are you using, MS SQL, Oracle, MySQL, Access, or something else?My guess is you can do a conditional statement (if/else) using the appropriate language for the database, Transact for MS SQL, PL/SQL for Oracle, and the others have similiar capapbilities.At that point you could place all of this in a stored procedure so that you only call one thing in your code but it would execute all of it.Well, clarify the question and provide the database being used, and if you can also include the method you are using it (VB, PHP, ASP, etc.) then hopefully we can answer your question better.

  7. Well, I can't say I am a MySQL expert either...but I love to learn and this sounds like a good one to try and figure out. I will see what I can dig up tomorrow. But in the meantime, if you can create/delete users....if needed, when you want to edit rights, you could just delete the user and re-create them with the rights they had previously (with the modified one's added/deleted). Its an ugly fix, but it seems to me that it would work for now until a better solution can be found.I'll let you know if I can find anything else on the issue. As of right now I have just seen how to add user's in MySQL 4.0 using GRANT and INSERT commands. I have not seen any that could be used to do updates, but like I said I am interested so I'll look around when I get a chance.

    Alias

    nope, just stayed at a holiday inn last night!lol - actually just learning more and more from the legacy code I have to deal with on a daily basis.:)You should see some of the Stored Procedures.:)

    Oh, I can imagine....we have 27 databases on one of our servers....pretty ridiculous actually....but its hard to fix now, although we are in the process. All the developers have been working to get rid of all in-line SQL and use Stored Procedures so the DBA could 1. Optimize all SQL Queries, 2. Whenever we begin migrating to a new Data Model (a much more efficient one, mind you) the changes can be made in as few places as possible.But yeah, working with the stuff has taught me a lot. I had a database class when I was in school but learned nothing....within a short time of being here, I went through the SQL tutorial here on w3schools, started learning where everything was stored and then went through a book and now it at least feels like I could do whatever I want within a database :( Of course I know there is still much to learn, but that is what I am in this forum for, if somebody asks a question I can answer great, if I can't answer it then I either find the answer to help them, or learn from when other people post answers. Either way its a win-win for me :D
  8. What type of naming conventions do each of you use (if any) for SQL?For databases, tables, column names, views, stored procedures, etc.At the company I work for our standards are:Databases (no true standard and the overall data model here should not be followed ever)Tables (usually starts with an Object name (usually the application that will use the table, or something such as Ordd (for Order) or Cust (for Customer).The column names have no standard naming convention really other than foreign keys are named the same as the primary key in the table they relate to.Views are prefixed with vwStored Procedures are prefixed with sp_ and then the action they perform (Get, Insert, Update, Delete, Create, Count, RPT (for Reports), Save) then a few key words to describe them.Of course there are those cases where a developer either didn't know the standards or decided to completely neglect them and for whatever reason it passed through.So what about everybody else?

  9. Hi, :) Try with Limit keywordORI can tell it another way but its not properIn whatever  order u want like asc ,descthen take first 10 rowSo easyyyyyyyy

    The Limit Keyword and the Top Keywords have already been shown to him and are not allowed in SQL*Plus, and he is already performing the ordering (see original post). His question is how to get just the first 10 rows of his query using syntax that is allowed in SQL*Plus.

    Alias

    Skemcin has given a great description of what aliases are and how to use them.I personally use them a lot at work when performing joins because the tables I am often joining are in different databases, so without aliases here is my query:SELECT database1.dbo.table1.address, database2.dbo.table2.cityFROM database1.dbo.table1, database2.dbo.table2WHERE database1.dbo.table1.idnum = database2.dbo.table2.idnumWith aliases:SELECT a.address, b.cityFROM database1.dbo.table1 a, database2.dbo.table2 bWHERE a.idnum = b.idnumNow, you which do you think is easier to read/type out? (And keep in mind that the more columns/where clauses you use the bigger the difference between the two). Obviously if my queries are going to be used longer than the one search I try to come up with short descriptive aliases, but I think you get the point.

  10. is probably the response you will get

    In case you are wondering where that anticipated response comes from, check out this other thread concerning languages:http://w3schools.invisionzone.com/index.php?showtopic=121And if you wnat to e-mail/IM the admin/moderators, go to the Home Page for the Forum, look at the bottom and where you see the "Top 10 Poster's Today", "Top 10 Overall Poseters", you should see another link called "Moderating Team". Go to that page, and then choose one of the moderators, I would suggest Kaijim as I have seen him around in a few other threads (like the one mentioned above).While I am an English speaker, I understand the need each of you have to be able to read all of this information in your native language and if he sees a large enough need to translate some of the pages then he might go for it one day, it never hurts to ask, best of luck.
  11. I think we should email them, they probably check their email often.

    Okay, I e-mailed the moderators. Here is the e-mail I sent for everyone to see:---------------------Kaijim,I first want to say you have created a great website with a lot of useful information and the message boards are very popular. As time passes they have become more popular and are therefore creating a lot more need for additional moderators. We understand that you do not have time to go over the boards everyday, so we suggest that a few people be given moderator privelages to pin topics such as Favorite HTML Editors, to delete duplicate topics such as one of the latest post in SQL (the member posted exact same question twice), and to edit/delete threads that should not be tolerated, such as the "How do you hack?" type threads.Please take a look at the thread to see everyone's opinion on the matter and please consider this requests.Here is the thread:http://w3schools.invisionzone.com/index.ph...wtopic=648&st=0Thank you,KCarson
×
×
  • Create New...