Jump to content

Search the Community

Showing results for tags 'sql'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 191 results

  1. i Have 3 table with following fields, 1.users table id, name, password, sub category id, email 2. category table categorie name, category id 3.subcategory table sub category name, sub category id, category id my questian is, how to get users details from user table using category id???????? pleae help
  2. I have a query where I will display how many transactions are made base on the amount of each transaction. But it has an error, the error is that the last amount which is 1,000 above is the same with the total transaction. Can someone check my query? This is my query: SELECT restaurant_master.code, restaurant_master.name, COUNT(CASE WHEN mds_orders.GrossTotal < '100' THEN 1 END) AS less100, COUNT(CASE WHEN mds_orders.GrossTotal >= '100' AND mds_orders.GrossTotal < '200' THEN 1 END) AS less200, COUNT(CASE WHEN mds_orders.GrossTotal >= '200' AND mds_orders.GrossTotal < '300' THEN 1 END) AS less300, COUNT(CASE WHEN mds_orders.GrossTotal >= '300' AND mds_orders.GrossTotal < '400' THEN 1 END) AS less400, COUNT(CASE WHEN mds_orders.GrossTotal >= '400' AND mds_orders.GrossTotal < '500' THEN 1 END) AS less500, COUNT(CASE WHEN mds_orders.GrossTotal >= '500' AND mds_orders.GrossTotal < '600' THEN 1 END) AS less600, COUNT(CASE WHEN mds_orders.GrossTotal >= '600' AND mds_orders.GrossTotal < '700' THEN 1 END) AS less700, COUNT(CASE WHEN mds_orders.GrossTotal >= '700' AND mds_orders.GrossTotal < '800' THEN 1 END) AS less800, COUNT(CASE WHEN mds_orders.GrossTotal >= '800' AND mds_orders.GrossTotal < '900' THEN 1 END) AS less900, COUNT(CASE WHEN mds_orders.GrossTotal >= '900' AND mds_orders.GrossTotal < '1000' THEN 1 END) AS less1k, COUNT(CASE WHEN mds_orders.GrossTotal > '1000' THEN 1 END) AS gtr1k, COUNT(mds_orders.GrossTotal) AS total FROM mds_orders JOIN restaurant_master ON mds_orders.RestaurantID = restaurant_master.PKID WHERE mds_orders.OrderDate BETWEEN '2011-11-01' AND '2011-11-30' GROUP BY restaurant_master.code, restaurant_master.name"; --Thanks. Best Regards.
  3. I would like to show my results like youtube...i know that it uses <div> inside a <div> and then align them with css BUT ! im not sure if it uses the " $row['file_link'] " way or if there is a better way ! thank you
  4. I am working on a website for my work but they will not give me a webserver. So basically I have to run it off a fileshare. This limits me to HTML, Javascript, and CSS formats to get anything done. I need to be able to accept data entered into a form and store it somewhere so it can later be queried for analysis in another website type format. Any suggestions? Somethings to keep in mind also so you know what I'm working with here. - older dell workstations running XP- IE7 is the only browser we are able to use on the work machines- No web server access or ability to pull in data from outside resources since the machines do not have internet access.
  5. Hello internet. I am trying to set up a query that will check to see if there is a row in the database that has the same name the user is trying to submit. Here is my code... how do I make this work? <?php$con = mysql_connect("xxx","xxx","xxx");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("xxx", $con);$entry=mysql_query("Select FROM testmysql where name='$_POST[rname]'");if($entry='$_POST[rname]');{echo "There is an entry that already exists with the name you selected. Please change the name and re-submit. Thanks.";die();
  6. Hello internet. I am finding it difficult to find any information on how to actually select just one row of data based on the user supplying two specific entries. Any suggestions? I have tried to use select but cannot get it to work to pull a row out with the user specifying which row by entering two specific entries. Please help.
  7. Hello internet.I am working on a project that will need to allow the user the option to delete information they have submitted. What is the proper way to set up a query that will allow the user to enter a specific piece of information from a specific field to be able to delete that whole row of data?
  8. assassin87

    Sum Same Values

    Hi everyone, i want to ask a question. I have some company name and totalroom in my procedure. But when i execute my procedure they are coming twice or more. İ want to sum companies at once. İ took a photo if you check that u will understand what i mean. http://imageshack.us/content_round.php?page=done&l=img546/5725/adszobb.jpg&via=mupload&newlp=1 here is my sql SELECT S.agency, SUM(S.totalroom) ODA, SUM(S.totalpax) KISI, (S.totalrevenue) GELIRFROM SP_FORECAST_OCC_LINE_DAY('01.01.2011','31.12.2011') Swhere S.resmarket='IC PAZAR' AND S.transdate BETWEEN '01.12.2011' and '31.12.2011'GROUP BY S.totalroom, S.agency, s.resmarket, S.totalrevenue
  9. Hello I have this SQL Statement: de.SqlStatement = "SELECT A.Name, A.Catagory , COUNT(Patient_ID) AS PNO FROM PatientApplyToAssociation P INNER JOIN Association A on A.Association_ID = P.Association_ID WHERE A.Catagory='" & "health" & " '" & "' GROUP BY A.Name '" with this Exception: System.Data.SqlClient.SqlException was unhandled by user code class="16" ErrorCode=-2146232060 LineNumber=1 Message=Column 'Association.Name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. I had this exception when I added the where clause, It seems that the compiler cant see the Group By Section , because of the quotation ending before it, I tried to write it like this: de.SqlStatement = "SELECT A.Name, A.Catagory , COUNT(Patient_ID) AS PNO FROM PatientApplyToAssociation P INNER JOIN Association A on A.Association_ID = P.Association_ID WHERE A.Catagory='" & "health" & "' GROUP BY A.Name '" & " '" But it was an Incorrect syntax near ' '. p.s. I selected A.Catagory because I needed it in the WHERE clause, I need the category to be "health"Any ideas ? Please Help me..Thank you
  10. Hi everyone i want to ask something. Now i have six queries from same stored procdure but i want combine that queries just one query. Here my queries GELİRSELECT SUM(REVENUE) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) DÜZELTMESELECT SUM(REVENUE) FROM SP_FOLTRANS_STATS_DAY (:B1,:D1) WHERE PAYTYPE='DUZELTME' KREDİSELECT SUM(PAYMENT) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) WHERE PAYTYPE='KREDI' NAKİTSELECT SUM(PAYMENT) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) WHERE CASHTYPE = 'NAKIT' KREDİ KARTISELECT SUM(PAYMENT) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) WHERE CASHTYPE = 'MASTER' OR CASHTYPE = 'VISA' İNDİRİMSELECT SUM(PAYMENT) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) WHERE PAYTYPE = 'INDIRIM' Now i want GELIR,DUZELTME,KREDI,NAKIT,KREDI KARTI AND INDIRIM with just one query. Can you help me, how can i do that ?
  11. Is there a command line in PHP which can export phpmyadmin data to csv files?
  12. Hi everyone, can anyone help me what is Select 1 query ?
  13. Database Name as Parameter / Variable Hi im using SQL Server Management Studio 2008 addition and im trying to specify a database name for a fix database script we run: ALTER DATABASE MyDatabase SET EMERGENCYDBCC checkdb('MyDatabase')ALTER DATABASE MyDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATEDBCC CheckDB ('MyDatabase', REPAIR_ALLOW_DATA_LOSS)ALTER DATABASE MyDatabase SET MULTI_USER When I try to replace MyDatabase with a variable the code will not run! Does anybody have any ideas? FYI: Im just learning SQL; please treat me like an idiot! Thanks all
  14. I am making eCommerce Store..there are lot's of inventory and it's update everyday.. I confused, which database support fast indexing ? MySQL, Oracle, MSsql
  15. Hello everyone! The reason I came to these forums is because i have an issue with my code, could you guys look at it and tell me what i am doing wrong?I am trying to retrieve an image from my SQL database in the form of a binary blob, but it doesn't show up. This is the code of the PHP file i am using in my image src html tag: <?phprequire_once("connect.php"); $imgd = $_get['img'];$query="SELECT * FROM ads WHERE id=$imgd";$result=mysql_query($query) or die ("Error - ");$row = mysql_fetch_assoc($result);$image = $row['fotolocatie']; echo $image;;?> it doesn't show the error so it isn't the query witch fails. - Kevin
  16. Hi i'm a newbie in this forum i like W3S is the best page ever for learning and be a web developer and i need help... how do i know if a filed is empty on php & mysql block code and make a redirection on the same page or other files for example... if we have a form called and have this code <html><body><form action="insert.php" method="post">Firstname: <input type="text" name="firstname" />Lastname: <input type="text" name="lastname" />Age: <input type="text" name="age" /><input type="submit" /></form></body></html> and then we have this file call it <?php$con = mysql_connect("localhost","peter","abc123");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("my_db", $con);$sql="INSERT INTO Persons (FirstName, LastName, Age)VALUES('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con)?> and if a have fristname as a UNIQUE field in mysql... how do i know if a field is empty and make a redirection to a pages or file? (that includes same files on your root folder) i hope that you help me thx
×
×
  • Create New...