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 194 results

  1. aghftec

    SQL installation

    Hello, I have installed different versions of SQL Server in my laptop (Asus X44H), but here is the error -> (provider: Named pipes provider, error:40- could not open a connection to SQL Server)(Microsoft SQL Server, Error:2) SQL Server instance MSSQLSERVER could not be installed, I don't know why! (I checked that in services.msc, there is no MSSQLSERVER), I have also changed my windows-10 but the issue has not been resolved yet. Any Solutions? Thanks.
  2. Hi . I'm having trouble with the AUTO INCREMENT statement in SQL. I've built the table : CREATE TABLE tenants( apartment_number_first_floor INT AUTO_INCREMENT, family_name VARCHAR (12) DEFAULT NULL, sur_name VARCHAR (8) DEFAULT NULL, telephone_number INT(3) NOT NULL, PRIMARY KEY (apartment_number_first_floor) ); when inserting a row: INSERT INTO tenants VALUES(' ',' '); The IDE doesn't accept the column count: ER_WRONG_VALUE_COUNT_ON_ROW: Column count doesn't match value count at row 1 So i tried filling the rows just to check if the IDE will run the statement INSERT INTO tenants VALUES(103,'שקלובין','מרתה',203); but the IDE refuses to increment Any ideas? Thanks
  3. Hi, How can I show string results as characters in sql plus? select* from example a where a.insert_time>='12-dec19' and a.status=1 as 'Cars I want that if 'status' field status result would show '1' the the output would show 'Cars' and if the result would show '2' the the output would show 'Bikes' instead of strings. Best regards
  4. Hi, How can I show string results as characters in sql plus? select* from example a where a.insert_time>='12-dec19' and a.status=1 as 'Cars I want that if 'status' field status result would show '1' the the output would show 'Cars' and if the result would show '2' the the output would show 'Bikes' instead of strings. Best regards
  5. Hi I have a query that returns the count of entries based on CURDATE(), it works for any dat in this month (April) but does not work for next month (May). I think it is something to do with CURDATE()+3 returns 2018-04-31 which should be 2018-05-01 This Works as Date is in April SELECT COUNT(Machine) FROM production WHERE Status = 'Confirmed' AND DATE(FROM_UNIXTIME(production.Required)) = CURDATE() This does not work as in May SELECT COUNT(Machine) FROM production WHERE Status = 'Confirmed' AND DATE(FROM_UNIXTIME(production.Required)) = CURDATE()+3
  6. There is a table, named student_mark and I have to find which 2 students are having min marks.I also tried group by but it is not working.
  7. jj304

    SQL Tryit Editor

    Hi, I'm using the SQL TryIt Editor but the Truncate Table command seems to fail when running. It states there is a syntax error but i cannot see any issue. Is anyone else able to truncate one of the existing tables? Thanks,
  8. Hello everyone, i must do a query that finds all words that finish whit a,e,i,o or u. i' ve used this query but my output in empty . select City from Station where City like '%[aeiou]'; i' ve used the wildcards wrongly?
  9. Hello All, I am trying to get the latest record available for a field, I want to learn how to write/pull what I know as of record status "1" from my results since let's say; an activity was updated several times but I just need the latest update base on the date, I tried using distinct and it worked: each row is different but I am still receiving all the updates of each activity. I tried to use (Group by) base in the activity Id and I am receiving this error message "Column 'activity_name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause." I am using the Microsoft SQL server management studio.
  10. Hi, I want to be able to filter by date looking back 6 months. I then want to include data from 12 months, 18 months, 24 months etc How would i do this without having to repeat myself? Currently i am using the below and then repeating it e.g between dateadd(dd,-189,getdate()) and dateadd(dd,-183,getdate()) between dateadd(dd,-373,getdate()) and dateadd(dd,-366,getdate()) Thanks in Advance,
  11. Hi, I am trying to join two tables that have similar fields, but in slightly different formats. I was previously using something along the lines of like '%*%' Then SUBSTRING(b.fieldname,CHARINDEX(b.fieldname,'*',1)+1,9) However the format has now changed and I am struggling to put something together. Table A BD8K1 23161*35*201904231110*QULN Table B 23161*35*1 However the number of characters in both could vary so cant use that. Table A BD8K1 242875*10*201904251015*NBB1 Table B 242875*10*113 Is there some code that could be written that's something like: A – From the space use the value up to and including the 2nd * (BD8K1 is at the beginning of every value in table A so could potentially use from character 7) B – Use the value up to and including the 2nd * Any help would be very much appreciated. Thanks James
  12. Hello w3schools community ! I would like to know .. - What is exactly the difference between SQL ( Structured query language ) and MySQL ?, ( with examples if possible ) - Does learning SQL suffice ? Or should I use a RDBMS such as MySQL, Oracle .. etc ? Thank you .
  13. I have a diagram representing a database and need to find a way to update a given table with respect to information about elements in that table. Here is the database design: https://i.stack.imgur.com/HR6q2.jpg I have a Playlist defined which is called "Frank's Stuff" which is owned by the Customer Frank Harris. The question is the following: Update the playlist "Frank's Stuff" as a function of the track duration. Display this playlist with the TrackID, Name and Milliseconds to verify. I've read that you cannot use an ORDER BY statement with and UPDATE statement unless it is enclosed in a SELECT statement. I'm not quite sure how to do all this though and would greatly appreciate some help. Thanks!
  14. shivangi saxena

    sql-DDL

    can we grant / give access of DDL commands to others ?
  15. So I'm trying to filter some records out of my select inside a form on my website. Problem is that I currently have this setup: Database Table1 Time Number Table2 Number Something I'm trying to filter time by checking how many records show up of number in table2 So basically I select time from table1 where number is less than <some amount> in table2 How do I actually put that in sql? I currently have this but it isn't working: SELECT Time FROM Showcase WHERE Number IN (SELECT COUNT(Number) FROM Build WHERE COUNT(Number) < 50); it currently doesn't end up with anything but in theory it should show the times from the records where the count of the value of number is less than 50 so if Number = 40 and it gets counted 70 times it shouldn't show up. but if Number = 30 is counted 29 times it should show up can anyone tell me what is going wrong?
  16. Hiral

    Help in SQL query

    Hello Everyone, I am writing a query in SQL to pull the first date an employee became a teacher with no break in service. using the job table here to find effective date when a employee became teacher like example. 1. Teacher - 1/1/18. 2. coordinator- 2/1/18 3. Teacher- 3/1/18 Here in result I need the last entry as there is no gap in that title now.
  17. No keywords are highlight. for what reason behind that. please help me Here is my HTML code and at the bottom PHP. HTML CODE: <form id="nbc-searchblue1" method="post" enctype="multipart/form-data" autocomplete="off"> <input type="text" id="wc-searchblueinput1" class="nbc-searchblue1" value="<?php echo $search; ?>" placeholder="Search Iconic..." name="search" type="search" autofocus> <br> <input id='nbc-searchbluesubmit1' value="Search" type="submit" name="button"> </form> PHP CODE: <?php // We need to use sessions, so you should always start sessions using the below code. session_start(); // If the user is not logged in redirect to the login page... if (!isset($_SESSION['loggedin'])) { header('Location: ../index.php'); exit(); } include 'connect.php'; $search = $sql = ''; if (isset($_POST['button'])){ $numRows = 0; if (!empty($_POST['search'])){ $search = mysqli_real_escape_string($conn, $_POST['search']); $sql = "select * from iconic19 where student_id like '%{$search}%' || name_bangla like '%{$search}%' || name like '%{$search}%' || phone like '%{$search}%' || blood like '%{$search}%' || district like '%{$search}%'"; $result = $conn->query($sql); $numRows = (int) mysqli_num_rows($result); } if ($numRows > 0) { echo "<table> <thead> <tr> <th><b>Photo</th> <th><b>Student ID</th> <th style='font-weight: 700;'><b>নাম</th> <th><b>Name</th> <th><b>Mobile No.</th> <th><b>Blood Group</th> <th><b>Email</th> <th style=' font-weight: 700;'><b>ঠিকানা</th></tr></thead>"; while ($row = $result->fetch_assoc()){ $student_id = !empty($search)?highlightWords($row['student_id'], $search):$row['student_id']; $name = !empty($search)?highlightWords($row['name'], $search):$row['name']; $district = !empty($search)?highlightWords($row['district'], $search):$row['district']; echo "<tbody>"; echo "<tr>"; echo "<td>" . "<div class='avatar'><a class='fb_id' target='_blank' href='https://www.facebook.com/" . $row['fb_id'] . "'><img src='" . $row['photo'] . "'><img class='img-top' src='fb.png'></a>" . "</td>"; echo "<td data-label='Student ID'>" . $row['student_id'] . "</td>"; echo "<td data-label='নাম' style=' font-weight: 700;'>" . $row['name_bangla'] . "</td>"; echo "<td data-label='Name' style='font-weight:bold;' >" . $row['name'] . "</td>"; echo "<td data-label='Mobile No'>" . "<a href='tel:" . $row['phone'] . "'>" . $row['phone'] . "</a>" . "</td>"; echo "<td data-label='Blood' style='color:red; font-weight:bold;' >" . $row['blood'] . "</td>"; echo "<td data-label='Email'>" . "<a href='mailto:" . $row['email'] . "'>" . $row['email'] . "</a>" . "</td>"; echo "<td data-label='ঠিকানা' style='font-weight: 700;'>" . $row['address_bangla'] . "</td>"; echo "</tr>"; echo "</tbody>"; } } else { echo "<div class='error-text' style='font-weight: 700;'>No Result</div><br /><br />"; } } $result = $conn->query("SELECT * FROM iconic19 $sql ORDER BY id DESC"); function highlightWords($text, $word){ $text = preg_replace('#'. preg_quote($word) .'#i', '<span style="background-color: #F9F902;">\\0</span>', $text); return $text; } $conn->close(); ?>
  18. JCabral

    JCabral

    Hi I am new to this forum and very new to this SQL issue. As you know Excel allows you to sort a set of data in ascending or descending order and through an ordered list. And here begins my problem, ie I would like to know if it is possible to do this order through a SQL statement. Sort ascendingly and descending I already know how to do but what I wanted, and it is shown in the example I attached, it was first to sort by field F58 in ascending order and then to sort by field F66 by the following list 'RR-CON, RR-COGP, RR -COCN, RR-COCS, RR-COGL, RR-COS ' I've got an example, with the VBA code that fetches me a table from the F58 and F66 values according to certain criteria, and then that data is only sorted by field F58, I'd like it to be sorted from the list above. It's possible? Many thanks Jorge Cabral Teste com SQL_V1 - ENG.xlsm
  19. Hiral

    NEED HELP IN SQL QUERY

    Hi, Need help in code trying to find employees old positon number but the job table gives current row position number since the employee was rehired. Please help.
  20. PLEASE HELP IN A QUERY. i AM TRYING TO DO SELF JOIN WITH A QUERY WHICH 2 OR MOR ELEFT OUTER JOINS IN IT. HOW TO DO SELF JOIN HERE . THANKS IN ADVANCE.
  21. I am having a small issue translating my excel if statement into a CASE clause. Bellow I have posted my current SQL statement and the IF statement i am trying to fit in. I At the moment i have wrote it into the WHERE Clause but when i run it only returns the data which applies to the product description. Because of the way my where clause is set up it mean i only get half results where as i want it to show if column a does not match criteria then look for certain items in column b IF Statement is =IF(PD="AC","S",IF(PD="CS","S",IF(PD="CA","S",IF(**PT="SS","S"," ")**))) Current SQL SELECT AEOrdersReceivedCurrentQuarter.`Order Company` , AEOrdersReceivedCurrentQuarter.`Sop Order Number` , AEOrdersReceivedCurrentQuarter.`Order Date` , AEOrdersReceivedCurrentQuarter.`Order Method` , AEOrdersReceivedCurrentQuarter.`Payment Method` , AEOrdersReceivedCurrentQuarter.`Product Type` , AEOrdersReceivedCurrentQuarter.`Product Sub Type` , AEOrdersReceivedCurrentQuarter.`Product Description` , AEOrdersReceivedCurrentQuarter.`Quantity Ordered` , AEOrdersReceivedCurrentQuarter.`Product Item Value` , AEOrdersReceivedCurrentQuarter.`Order Count` , AEOrdersReceivedCurrentQuarter.`Order Item Narrative` , AEOrdersReceivedCurrentQuarter.`Product Group` , AEOrdersReceivedCurrentQuarter.`Product Category` FROM AEOrdersReceivedCurrentQuarter.csv AEOrdersReceivedCurrentQuarter WHERE (AEOrdersReceivedCurrentQuarter.`Product Type` = 'Studio Services' OR AEOrdersReceivedCurrentQuarter.`Product Description` IN ('Artwork Charge','Creative Services','Creative Agency','Studio Services') )
  22. Hello, I have a report looking at courses for my college. Each course can have multiple attributes (which I return with a sub query for each stating 'Y' or 'N' if they are associated with said attribute). My end user is requesting an additional column which states if they are associated with multiple attributes - so the column will return 'Y' if they have multiple attributes, or a 'N' if they only have one attribute. I am requesting assistance in coding the 'Multiple' column, as I am returning a Y or N for each attribute by using sub queries, and not quite sure how to compare the sub queries together to return a value if they have multiple attributes (meaning more than one of the sub queries will return a 'Y'). Thank you.
  23. I have a website named Advisorymandi.com - From last 2 days I'm facing unwanted traffic from unknown source. Its Server is not working even website is not open. Can any one help me please to resolve it.
  24. Hi all ! I wrote this short code : <html> <head> <style> table, th{ max-width: 600px; } .e2 { width: 200px; } </style> </head> <div style="background-color:TRANSPARENT;width:603px"> <body> <table> <tr bgcolor="TRANSPARENT" height="20"> <td class="e2" style="background-color:GREEN"></td> </tr> </table> </body> </div> </html> I have a data base column (in oracle apex), And I would like to have something like that (a multiplication) : .e2 { width = #column# * 600; } Because I would like to have a green horizontal bar chart with different size depending on the values in my database column. So, I tried calc() : did not work... And I also tried : <td style="background-color:GREEN" width=#column#*600></td> <td style="background-color:GREEN" width=calc(#column#*600)></td> Those 2 lines did not work too.. Do you have any idea how to do this multiplication please ? Best regards, acnos
  25. Hi everyone, I will like to know how to have table under master table. Is it relationship? or how you do that? Thanks, Gary
×
×
  • Create New...