Jump to content

Search the Community

Showing results for tags 'sql'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








  1. hello friends I have two tables with column A and column B. I want to update column B of table9 with column B of table1 . I am trying this query in ms access from Vb.net. It pastes the column below the existing data. How do I write a update query that will replace the existing column? update table1 t1 LEFT JOIN table9 T9 on t1.a = t9.a SET t9.b = t1.b Thanks
  2. TotalWhat

    SQL Question

    This question has been solved. The solution is at the bottom. Hi! So here's the question for you. I use Microsoft SQL Server Management Studio. I have a table 'Frogs', that has two attributes. FrogName and FrogHabitat. If I do a select * from the table the output is something like this: FrogName FrogHabitat Wood frog Iceland Wood frog Denmark Wood frog Sweden Sky frog Iceland Sky frog Germany Hill frog France Hill frog Sweden The question is: "Write the query that would produce the FrogName of pair
  3. Does Anybody have a SQL code that does the following ones of or is it done in parts?1. DB Schema Design - Design a basic database to store the following information + A fleet of Vehicles - Include details such as mileage, vin numbers etc + A pool of drivers - Include relevant documentation, e.g. Drivesr license, ID Book + A group of routes - Marking out GPS coords for directions etc. is not necessary, just include a start & end address as well as any other info you believe to be pertinent + A drivers schedule, tying the above 3 tables together
  4. my focus is across a whole 3 years (156 weeks) of data, beginning January 1st 2011 (or nearest date) and ending December 31st 2013 (or nearest date) – so while we are looking at 3 years total, we will only end up with 52 weeks in our clean version of the data, labelled Week 1 to Week 52 (and not dates).there will be items in this list that launched before 1st Jan 2011, for which part of the launch year will show up in the period we’re focused on. In order that data percentiles (will be calculated at later stage) are not clouded by this, we also need to move any part year data from launches pre
  5. I am trying to process a string which contains various data relating to an elearning record; Moodle SCORM suspend_data if you're familiar with it Since I do not have access to server side SQL/CLR functions through the Moodle interface, I am attempting to reference, and extract, the relevant information from the string by explicitly referencing the character locations of the information I need in the string and then converting them as required so they can be summed e.g. SELECT prefix_user.username,........ ((CASE(SUBSTRING(value_rep,237,1)) WHEN 'c' THEN 1 ELSE 0 END) + ........(CASE(SUBSTRIN
  6. From the tables that I attached, a. Assume Job relation is created. Write the SQL statement that will create the EMP relation (use the structure shown in Table 2) Following is my answer: Create Table EMP (empnum NUMBER(3), lname VARCHAR2(15) CONSTRAINT emp_lname_nn Not Null, fname VARCHAR2(25), mi CHAR(1), hiredate DATE CONSTRAINT emp_hiredate_nn Not Null, enddate DATE, Jobcode CHAR(3), Salary Number(10,2) CONSTRAINT emp_empnum_pk Primary Key (empnum), CONSTRAINT emp_jobcode_fk Foreign Key (jobcode) REFERENCES Job(job_code); b. Write the SQL statement that will enter the first data row into
  7. Hello there, some help in this? Is it possible to calculate numeric data in table with data coming from forms? I mean something like this: mysql_query("UPDATE ov SET dt_ob=(dt_ob+'$suma1') WHERE smetka='$debit' ",$con) dt_ob and smetka are coloumns in the table, $suma1 and $debit are data coming from form. The code above do not work to me.
  8. Hello Ladies and Gents, I am new to sql and this forum so please forgive if I don't word my question very well. I'm having diffuculty retrieving data when trying to run more than 2 queries in w3schools course. I was trying to pull from customers, Orders, Products and OrderDetails as a training example to myself. What i'm asking is, if someone is willing, can they please write out a granular query that I can follow. I get different errors when trying to tweek my query. I want to be able to pull 3 or more tables at a time but know I'm missing a fundimental step or steps during my proc
  9. I'm trying to organize this SQL query from a packet capture and I'm more of a network/application guy, not so much of a DBA. Can anyone if I got this right and if this makes sense? I think the SQL query is this: SELECT [t0].[SECTIONNAME], [t0].[PARAMETERNAME], [t0].[INTVALUE], [t0].[STRINGVALUE], [t0].[DATEVALUE], [t0].[INFRASTRUCTURAL], [t0].[SiteParametersId] FROM [dbo].[SITE_PARAMETERS] AS [t0] WHERE ([t0.[SECTIONNAME] = @p0) AND ([t0].[PARAMETERNAME] = @p1) After that, is it defining the parameters used in the query like this? @UserId = @p1, @IsRoot = @p2 Here's the whole thing:
  10. Am designing a simple php forum platform using PHP and MYSQL to insert the data into myql database. But i use to get this kind of --[You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='4'' at line 1] PLEAS WHAT SHOULD I DO
  11. birbal

    opinion about ORM

    Do you use ORM in your production or commercial application? I think ORMs are good for maintaining OO relation with datbase, But it has its limitation. For DML ORM is great for faster development and minimize duplication of code. But for DQL I think it is hard to do complex SQLs with ORM. Raw SQL would go along well. I have read somewhere it is not good to fit something like RDBMS to OO which it is not. Anyway i dont know how many open source and commercial application uses it. It looks like OSCommerce prefer to not use ORM. I have own written active record like ORM which uses Reflection
  12. i need help with useing one table to count another tables enteries
  13. Hi, I would like to use <input type=file> to allow user to upload file (pictures, pdf...) and save them as varinary on SQL server. I can do it using asp.net but want to use html5 and javascipt. I imagine it will take some sort of ajax call to a web service written in vb.net. Does someone have an example?or a resoource? My specific questions are how to get the file from the <imput> and pass that file to web service? Thanks John
  14. I am new to sql and want to do some practice stuff hence requires list of two tables which having relation with each other for example product and order table. these are the two tables having relation with each other through productid column. producttable ordertable productid productname price color weight orderid productid customer
  15. Hi guys, i need to finish an assignment but keep getting the error: ERROR 1111 (HY000): Invalid use of group function The assignment goes as follows: Give a list of cruises (c_code, description) for all cruises and their number of passengers that have more passengers then average. There are 3 tables in the database: Booking, cruises and passengers. My code is :SELECT C_CODE, C_DESCRIPT, COUNT(DISTINCT(B_PASS)) FROM CRUISE, BOOKING WHERE (CRUISE.C_CODE =BOOKING.B_CRUISE) GROUP BY C_CODE HAVING COUNT(DISTINCT(B_PASS)) > AVG(COUNT(DISTINCT(B_PASS))); Obviously I'm doing someth
  16. I have a database of 5 tables. 1st table is my customer table. 2nd is my crust table. 3rd is my toppings table. 4th is my sides table. 5th is my order table. My crust, toppings and sides table all have a price column and I am trying to get them to add together on my order table total cost column. What function would be the best to use to accomplish getting the crust price toppings price and sides price to add up on the order table Total cost column? Here is my table schema: Crust TableCrustID Primary KeyCrustnameCrustsizeCrustprice moneyToppings TableToppingID Primary KeyToppingNameToppingPr
  17. My goal is to have users fill out three fields and click on a button that will check an sql table to see if there is a record with those three fields already in the database. I'm not 100% sure, but I think my issue is in my C# code calling the procedure. I have tested my stored procedure from sql and it works. I've tried a few things, but nothing is working. The code below is one of my attempts that isn't working. I'm not sure, but when I step through the program it doesn't appear to be calling the procedure (though I could be wrong and the problem is elsewhere). SqlConnection conn =
  18. Anyone have any suggestions.?? I have Table <customers> I need to query the data points in Column ID ( data type_ Int ) and Column Lot (data type_Int) FROM customers but what my query is doing is adding this two data points up. and I don't want a SUM result. ex. if ID = 100 and Lot = 543 my query result = 643 what I am looking for is IF ID=100 and Lot = 543 my query result should be= 100543 SELECT customers.ID + ' ' +customesr.Lot AS combined FROM customers ANY SUGGESTIONS PLEASE!!!
  19. Anyone have any suggestions.?? I have Table <customers> I need to query the data points in Column ID ( data type_ Int ) and Column Lot (data type_Int) FROM customers but what my query is doing is adding this two data points up. and I don't want a SUM result. ex. if ID = 100 and Lot = 543 my query result = 643 what I am looking for is IF ID=100 and Lot = 543 my query result should be= 100543 SELECT customers.ID + ' ' +customesr.Lot AS combined FROM customers ANY SUGGESTIONS PLEASE!!!
  20. Soooo I am taking a class called Electronic Commerce. My professor is is requiring us to make a website "selling" a product (not for real) and the website must use html 5, php and sql. He is not going to waste class time teaching us these because this is a "capstone" class and we should already be familiar. Well Html 5 I am ok with, but SQL and PHP, I am so lost. As far as I can figure out, the SQL is for my database. I have already gathered the jpgs, made a database of the spices with prices I will sell. I am not really sure how to attack this project and any help will by greatly ap
  21. Hello.I have this code $get_cart_info = mysql_query("select c.*,g.*,m.* from cart as c left join games as g on c.tid = g.id left join movies as m on c.tid=m.id where c.user = {$CURUSER['id']} GROUP BY c.tid") or die(mysql_error()); But what I need is when c.type is movie its only takes info from movies tabel, but still have to take everything out, because I both have movies and games in cart..Can it be done, or do I have to trying something else?
  22. Sir; I have developed a website for my Department of Science, which recently is hosted in USA. The website is programmed not to accept any form submissions after 8 pm. Also it gets redirected to "Site is down" page on Saturdays and Sundays. It was OK while the site was over in-house server. Now that its in USA, because the time zone now is different, it does not accept the forms after 8 pm in USA, which is 8 am here in India. Site does not accept forms from 8 am to 12 noon here in India. Also weekend redirect to "Site is down" is of no use due to date being different in USA and in India.
  23. Hi,I'm fairly new in SQL. Been trying for months to create the right script for this particular case but still cannot give me 100% result as required. Really appreciate your expertise. Sorry if my explaination below is quite lengthy. SCENARIO : I am required to query from 2 tables for those unique record that meets both conditions below:-1. Status is 1 @ max (trans_id), paychnl = CC2. Status is 2 @ max (trans_id), paychnl = A or B FYR, 2 tables and respective columns to query are as below:-table PTFF --> col ID, TRANS_ID,TRANSDATE,EFFDATE,TRANSCODEtable CHFF --> col STATUS,PAYCHNL F
  24. Hello guys, i need some experienced info here.. i need to sort selected data, thats why i used case like: SELECT * FROM Customers ORDER BY CASEWHEN CustomerName LIKE '%a%' THEN 1WHEN CustomerName LIKE '%b%' THEN 2ELSE 3END Everythings fine here, but I need to sort each sector (1, 2 and 3) seperately by CustomerName`s lenght. How to do that? any ideas ?
  25. I have a nifty query that pulls data by orders.orderid > '85000' (and I update that number every week based on orders.) But I want it to automatically pull the most recent 3,000 orders instead of changing that number all the time, so I was hoping to set a variable which is Max(order.orderid)-3000, thus pulling the last 3000 order records. Here is my static select: SELECT Orders.OrderID, Orders.OrderStatus, Orders.CustomerID, Orders.ShippingMethodID, Orders.BillingFirstName, Orders.BillingLastName, Orders.BillingAddress1, Orders.BillingAddress2, Orders.BillingCity, Orders.BillingState,
  • Create New...