Search Results

Search found 5122 results on 205 pages for 'max'.

Page 144/205 | < Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >

  • what's the name of this language that description another language syntax?

    - by Boolean
    for example: <SELECT statement> ::= [WITH <common_table_expression> [,...n]] <query_expression> [ ORDER BY { order_by_expression | column_position [ ASC | DESC ] } [ ,...n ] ] [ COMPUTE { { AVG | COUNT | MAX | MIN | SUM } ( expression ) } [ ,...n ] [ BY expression [ ,...n ] ] ] [ <FOR Clause>] [ OPTION ( <query_hint> [ ,...n ] ) ] <query_expression> ::= { <query_specification> | ( <query_expression> ) } [ { UNION [ ALL ] | EXCEPT | INTERSECT } <query_specification> | ( <query_expression> ) [...n ] ] <query_specification> ::= SELECT [ ALL | DISTINCT ] [TOP expression [PERCENT] [ WITH TIES ] ] < select_list > [ INTO new_table ] [ FROM { <table_source> } [ ,...n ] ] [ WHERE <search_condition> ] [ <GROUP BY> ] [ HAVING < search_condition > ] whats the language called?

    Read the article

  • TSQL - create a stored proc inside a transaction statement

    - by Chris L
    I have a sql script that is set to roll to production. I've wrapped the various projects into separate transactions. In each of the transactions we created stored procedures. I'm getting error messages Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword 'procedure'. I created this example script to illustrate Begin Try Begin Transaction -- do a bunch of add/alter tables here -- do a bunch of data manipulation/population here -- create a stored proc create procedure dbo.test as begin select * from some_table end Commit End Try Begin Catch Rollback Declare @Msg nvarchar(max) Select @Msg=Error_Message(); RaisError('Error Occured: %s', 20, 101,@Msg) With Log; End Catch The error seems to imply that I can't create stored procs inside of transaction, but I'm not finding any docs that say otherwise(maybe google isn't being freindly today).

    Read the article

  • Resolve circular typedef dependency?

    - by Nick
    What is the best way to resolve the following circular dependency in typedef-ing these structs? Note the C language tag - I'm looking for a solution in standard gcc C. typedef struct { char* name; int age; int lefthanded; People* friends; } Person; typedef struct { int count; int max; Person* data; } People;

    Read the article

  • Creating a textarea with auto-resize

    - by DisgruntledGoat
    There was another thread about this, which I've tried. But there is one problem: the textarea doesn't shrink if you delete the content. I can't find any way to shrink it to the correct size - the clientHeight value comes back as the full size of the textarea, not its contents. The code from that page is below. I'd appreciate any help or pointers. function FitToContent(id, maxHeight) { var text = id && id.style ? id : document.getElementById(id); if ( !text ) return; var adjustedHeight = text.clientHeight; if ( !maxHeight || maxHeight > adjustedHeight ) { adjustedHeight = Math.max(text.scrollHeight, adjustedHeight); if ( maxHeight ) adjustedHeight = Math.min(maxHeight, adjustedHeight); if ( adjustedHeight > text.clientHeight ) text.style.height = adjustedHeight + "px"; } } window.onload = function() { document.getElementById("ta").onkeyup = function() { FitToContent( this, 500 ) }; }

    Read the article

  • Css active isse:not working

    - by user297211
    How to make css active color be greeen when the hyperlink is clicked. i tried the below code but it does work Note that LeftNavBG_2 is a green image a:active.leftMenu { /* Left Menu */ font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; font-size: 14px; color: #000; text-decoration: none; width: 144px; margin-bottom: 5px; display: block; max-width: 144px !important; vertical-align: bottom; padding-top: 5px; padding-bottom: 5px; background-image: url(../images/LeftNavBG_2.gif); }

    Read the article

  • antlr: How to rewrite only specific

    - by user1293945
    I am sure antlr can solve my problem, but can't figure out how to implement it, even high level. I rapidly got caught into syntax problems of antlr itself. My grammar is quite simple and made of following tokens and rules. Don't really need to go in their details here. The evaluator resolves to expressions, which finally resolve to IDENT: evaluator : expression EOF! ; ... ... term : PARTICIPANT_TYPE(IDENT | '('! expression ')'! | max | min | if_ | NUMBER)+ ; Now, I would like to analyse and rewrite the 'term', so that IDENT tokens (and them only) get re-written with the PARTICIPANT_TYPE. All the others should simply remain the same.

    Read the article

  • .net load balancing for server

    - by user1439111
    Some time ago I wrote server software which is currently running at it's max. (3k users average). So I decided to rewrite certain parts so I can run the software at another server to balance it's load. I can't simply start another instance of the server since there is some data which has to be available to all users. So I was thinking of creating a small manager and all the servers connect and send their (relevant)data to the manager. But it also got me thinking about another problem. The manager could also reach it's limits which is exactly what i'm trying to prevent in the future. So I would like to know how I could fix this problem. (I have already tried to optimize critical parts of the software but I can't optimize it forever)

    Read the article

  • How to insert large files in mysql database using php? [closed]

    - by anjan
    Hi! I want to upload a large file of size 10M max to my mysql database. Using .htaccess i changed the PHP's own file upload limit to "10485760" = 10M, i am able to upload files upto 10M size without any problem. But i can not insert the file in database if it is more that 1M in size. i am using file_get_contents to read all file data and pass it to the insert query as a string to be inserted into a LONGBLOB field. But files with more than 1M size is not being added to database, though i can use print_r($_FILES) to examine that the file uploaded correctly. Any help will be appreciated and i will need it within next 6 hours. So, please help! best regards, Anjan * This is a duplicate of http://stackoverflow.com/questions/492549/how-can-i-insert-large-files-in-mysql-db-using-php *

    Read the article

  • Need help with a sub query/group/order (get latest comment for each ordered topic)

    - by Scarface
    Hey guys I have a query that currently finds the latest comment for each of a user's topics and then orders topics by that comment's timestamp. What I want to do is expand on this query's use and print the latest comment for each topic. The problem with this query is that while it orders the topics correctly, it prints seemingly random comments for each topic. I am trying to implement a sub query but I am not quite sure how to approach it. I was thinking that I just had to somehow use this query to get the comments. If anyone has any ideas I would really appreciate it. Here is what I think I need to add SELECT * FROM comments where topic_id='$topic_id' ORDER BY timestamp DESC LIMIT 1 Here is the query I need to modify SELECT topic.topic_title, topic.content_type, topic.subject_id, topic.creator, topic.description, topic.topic_id,comments.message,comments.user FROM comments JOIN topic ON topic.topic_id = comments.topic_id WHERE topic.creator = '$user' AND comments.timestamp > $week GROUP BY topic_id ORDER BY MAX(comments.timestamp) DESC

    Read the article

  • How to join the results of two tables in django python

    - by user1787524
    I have two models class Weather(model.model): region = models.ForeignKey(Region) district = models.ForeignKey(District) temp_max = models.IntegerField(blank=True, null=True, verbose_name='Max temperature (C)') temp_min = models.IntegerField(blank=True, null=True, verbose_name='Min temperature (C)') and class Plan(model.model): name = tinymce_models.HTMLField(blank=True, null=True) region = models.ForeignKey(Region) district = models.ForeignKey(District) Provided for every region and district have unique row. I want to combine the result so that i can get all the columns of both tables These two Models are not related to each other. ' I need to make the join like join weather w on w.region = A.region and w.distric = A.district so that result contains all the columns in everyobject like obj.temp_max etc

    Read the article

  • SQL to get rows (not groups) that match an aggregate

    - by xulochavez
    Given table USER (name, city, age), what's the best way to get the user details of oldest user per city? I have seen the following example SQL used in Oracle which I think it works select name, city, age from USER, (select city as maxCity, max(age) as maxAge from USER group by city) where city=maxCity and age=maxAge So in essence: use a nested query to select the grouping key and aggregate for it, then use it as another table in the main query and join with the grouping key and the aggregate value for each key. Is this the standard SQL way of doing it? Is it any quicker than using a temporary table, or is in fact using a temporary table interanlly anyway?

    Read the article

  • Is it possible for PHP to generate a fresh page on every Javascript history.go(-1) ?

    - by Ho
    Hello, I have a PHP page (a.php) which is already sending these headers: <?php header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Pragma: no-cache'); ?> And on the PHP page (a.php) , it has a link to another page (b.html) on b.html, it has a javascript code to: <script type="text/javascript"> history.go(-1); </scirpt> It seems to me that, when the browser is "going back" to a.php,the content isn't fresh at all. Would you please advise me if generating a completely fresh page on history.go(-1) is possible? Thank you.

    Read the article

  • [MySQL] Optimize Query

    - by bordeux
    Hello. I have problem with optimize this query: SET @SEARCH = "dokumentalne"; SELECT SQL_NO_CACHE `AA`.`version` AS `Version` , `AA`.`contents` AS `Contents` , `AA`.`idarticle` AS `AdressInSQL` , `AA` .`topic` AS `Topic` , MATCH (`AA`.`topic` , `AA`.`contents`) AGAINST (@SEARCH) AS `Relevance` , `IA`.`url` AS `URL` FROM `xv_article` AS `AA` INNER JOIN `xv_articleindex` AS `IA` ON ( `AA`.`idarticle` = `IA`.`adressinsql` ) INNER JOIN ( SELECT `idarticle` , MAX( `version` ) AS `version` FROM `xv_article` WHERE MATCH (`topic` , `contents`) AGAINST (@SEARCH) GROUP BY `idarticle` ) AS `MG` ON ( `AA`.`idarticle` = `MG`.`idarticle` ) WHERE `IA`.`accepted` = "yes" AND `AA`.`version` = `MG`.`version` ORDER BY `Relevance` DESC LIMIT 0 , 30 Now, this query using ^ 20 seconds. How to optimize this? EXPLAIN gives this: 1 PRIMARY AA ALL NULL NULL NULL NULL 11169 Using temporary; Using filesort 1 PRIMARY ALL NULL NULL NULL NULL 681 Using where 1 PRIMARY IA ALL accepted NULL NULL NULL 11967 Using where 2 DERIVED xv_article fulltext topic topic 0 1 Using where; Using temporary; Using filesort This is example server with my data: user: bordeux_4prog password: 4prog phpmyadmin: http://phpmyadmin.bordeux.net/ chive: http://chive.bordeux.net/

    Read the article

  • Auto-Selecting Navigation works for active page but how to add class to parent menu items?

    - by jacqueschoquette
    I am following this article http://docs.jquery.com/Tutorials:Auto-Selecting_Navigation I am able to successfully add a class to the active page li menu item but does anyone know how to modify or add to this script so that any parent menu li items also get the active class? I would like to avoid having to add ID's as the menu items will be changing alot My menus have three levels max here is the script jquery script i am using $(function(){ var path = location.pathname.substring(1); if ( path ) $('.topLevel a[href$="' + path + '"]').attr('class', 'underline'); }); which works on the current page li a I thought I could go this route $('.topLevel a[href$="' + path + '"]').attr('class', 'underline').parent().attr('class', 'underline'); but it does not seem to work any ideas? a working example can be found here whistlerwebandprint.com/home.html

    Read the article

  • Finding Most Recent Order for a Particular Item

    - by visitor
    I'm trying to write a SQL Query for DB2 Version 8 which retrieves the most recent order of a specific part for a list of users. The query receives a parameter which contains a list of customerId numbers and the partId number. For example, Order Table OrderID PartID CustomerID OrderTime I initially wanted to try: Select * from Order where OrderId = ( Select orderId from Order where partId = #requestedPartId# and customerId = #customerId# Order by orderTime desc fetch first 1 rows only ); The problem with the above query is that it only works for a single user and my query needs to include multiple users. Does anyone have a suggestion about how I could expand the above query to work for multiple users? If I remove my "fetch first 1 rows only," then it will return all rows instead of the most recent. I also tried using Max(OrderTime), but I couldn't find a way to return the OrderId from the sub-select. Thanks! Note: DB2 Version 8 does not support the SQL "TOP" function.

    Read the article

  • JQuery Mobile bind event to listview

    - by nycynik
    I am trying to add a vclick to a dynamic JQM listview. But I can not figure out how to identify which number is being clicked. http://jsfiddle.net/2hR9w/ for (var x=0; x<2; x++ ) { $("#listitem"+x).bind("vclick",function(e) { console.log("clicked"+x); }); console.log(x); } ? Something is wrong with the code, but i can't figure out why x is always the max loop value, since I feel like it should be set at the time of the loop. it always reads clicked2, never clicked1.

    Read the article

  • How to predict result set row count?

    - by Saurabh Kumar
    I have an application where I create a big SQL query dynamically for SQL server 2008. This query is based on various search criteria which the user might give such as search by lastname, firstname, ssn etc. The requirement is that if the user gives a condition due to which the formed query might return a lot of rows(configurable for max N rows), then the application must send back a message instead to the user saying that he needs to refine his search query as the existing query will return too many rows. I would not want to bring back say, 5000 rows to the client and then discard that data just to show the user an error. What is an efficient way to tackle this issue?

    Read the article

  • SSRS Performance Mystery

    - by user101654
    I have a stored procedure that returns about 50000 records in 10sec using at most 2 cores in SSMS. The SSRS report using the stored procedure was taking 20min and would max out the processor on an 8 core server for the entire time. The report was relatively simple (i.e. no graphs, calculations). The report did not appear to be the issue as I wrote the 50K rows to a temp table and the report could display the data in a few seconds. I tried many different ideas for testing altering the stored procedure each time, but keeping the original code in a separate window to revert back to. After one Alter of the stored procedure, going back to the original code, the report and server utilization started running fast, comparable to the performance of the stored procedure alone. Everything is fine for now, but I am would like to get to the bottom of what caused this in case it happens again. Any ideas?

    Read the article

  • Duplicate / Copy records in the same MySQL table

    - by Digits
    I have been looking for a while now but I can not find an easy solution for my problem. I would like to duplicate a record in a table, but of course, the unique primary key needs to be updated. I have this query: INSERT INTO invoices SELECT * FROM invoices AS iv WHERE iv.ID=XXXXX ON DUPLICATE KEY UPDATE ID = (SELECT MAX(ID)+1 FROM invoices) the problem is that this just changes the ID of the row instead of copying the row. Does anybody know how to fix this ? Thank you verrry much, Digits //edit: I would like to do this without typing all the field names because the field names can change over time.

    Read the article

  • Confusing alias mySQL

    - by Taylor
    I keep getting the same number outputted for the Total Sales, Minimum Sale, Largest Sale and Average Sale. The Total Invoices is working perfectly, but I cant seem to figure out how to fix the other ones. Here's the query: SELECT SUM( b.`Number of Invoices`) AS `Total Invoices`, SUM( b.`Total Customer Purchases`) AS `Total Sales`, MIN( b.`Total Customer Purchases`) AS `Minimum Sale`, MAX( b.`Total Customer Purchases`) AS `Largest Sale`, AVG( b.`Total Customer Purchases`) AS `Average Sale` FROM (SELECT a.CUS_CODE, COUNT(a.`Number of Invoices`) AS `Number of Invoices`, SUM(a.`Invoice Total`) AS `Total Customer Purchases` FROM ( SELECT CUS_CODE, LINE.INV_NUMBER AS `Number of Invoices`, SUM(LINE.LINE_UNITS * LINE.LINE_PRICE) AS `Invoice Total` FROM `ttriggs`.`INVOICE`, `ttriggs`.`LINE` WHERE INVOICE.INV_NUMBER = LINE.INV_NUMBER GROUP BY CUS_CODE, LINE.INV_NUMBER ) a ) b GROUP BY b.CUS_CODE; Heres the database diagram https://www.dropbox.com/s/b8cy5l29jwh8lyv/1_edit.jpg Subquery generates: CUS_CODE 10011 Number of Invoices 8 Total Customer Purchases 1119.03 Any help is greatly appreciated, Thanks!

    Read the article

  • c++: at what point should I start using "new char[N]" vs a static buffer "char[Nmax]"

    - by dan
    My question is with regard to C++ Suppose I write a function to return a list of items to the caller. Each item has 2 logical fields: 1) an int ID, and 2) some data whose size may vary, let's say from 4 bytes up to 16Kbytes. So my question is whether to use a data structure like: struct item { int field1; char field2[MAX_LEN]; OR, rather, to allocate field2 from the heap, and require the caller to destroy when he's done: struct item{ int field1; char *field2; // new char[N] -- destroy[] when done! Since the max size of field #2 is large, is makes sense that this would be allocated from the heap, right? So once I know the size N, I call field2 = new char[N], and populate it. Now, is this horribly inefficient? Is it worse in cases where N is always small, i.e. suppose I have 10000 items that have N=4?

    Read the article

  • Help needed in pivoting (SQL Server 2005)

    - by Newbie
    I have a table like ID Grps Vals --- ---- ----- 1 1 1 1 1 3 1 1 45 1 2 23 1 2 34 1 2 66 1 3 10 1 3 17 1 3 77 2 1 144 2 1 344 2 1 555 2 2 11 2 2 22 2 2 33 2 3 55 2 3 67 2 3 77 The desired output being ID Record1 Record2 Record3 --- ------- ------- ------- 1 1 23 10 1 3 34 17 1 45 66 77 2 144 11 55 2 344 22 67 2 555 33 77 I have tried(using while loop) but the program is running slow. I have been asked to do so by using SET based approach. My approach so far is SELECT ID,[1] AS [Record1], [2] AS [Record2], [3] as [Record3] FROM ( Select Row_Number() Over(Partition By ID Order By Vals) records ,* From myTable)x PIVOT (MAX(vals) FOR Grps IN ([1],[2],[3])) p But it is not working. Can any one please help to solve this.(SQL SERVER 2005)

    Read the article

  • SQL to LINQ translating probem

    - by ognjenb
    I have problem with convertion this SQL statement to LINQ : SELECT a.Id, a.Name, a.ArtiklNumber, a.Notes, a.Weight, l.StartDate AS LastStartDate, l.LocationNameId, loc.Name AS CarrentLocation, a.Reserved FROM Accessories a LEFT OUTER JOIN Location l LEFT JOIN LocationName loc ON l.LocationNameId = loc.Id ON a.Id = (SELECT AccessoriesId FROM Location WHERE AccessoriesId = a.Id HAVING MAX(StartDate) = StartDate ) This is part of my translated code: testEntities6 accessoriesEntities = new testEntities6(); var max_StartDate = (from msd in accessoriesEntities.location from d in accessoriesEntities.device where msd.DeviceId == d.Id select msd.StartDate).Min(); var accessories_query = from accs in accessoriesEntities.accessories join l in accessoriesEntities.location on accs.Id equals l.AccessoriesId join loc in accessoriesEntities.locationname on l.LocationNameId equals loc.Id select new AccessoriesModel { //Accessories Id = accs.Id, Name = accs.Name, ArtiklNumber = accs.ArtiklNumber, Notes = accs.Notes, Weight = accs.Weight, Reserved = accs.Reserved, //Location LocationNameId = l.LocationNameId, StartDate = max_StartDate,//l.StartDate, //Locationname Loc_name = loc.Name };

    Read the article

  • jquery UI slider not working in Safari.

    - by Joe
    so i have the below code, which I think is fine: jQuery( function() { jQuery("#slider-vertical").slider( { orientation :"vertical", range :"min", min :0, max :100, value :50, slide : function(event, ui) { jQuery("#amount").val(ui.value); var movie = thisMovie('ClusterFlash'); fromScroll = jQuery("#amount").val(); if (movie) { currentSentiment = ((100 - fromScroll) / 100); movie.sentimentChange(currentSentiment); } } }); }); the 'movie' var above calls the following function, which seems to be where my problem is. function thisMovie(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return window[movieName]; } if(document[movieName].length != undefined) { return document[movieName][1]; } return document[movieName]; } Any help would be appreciated. Thank

    Read the article

  • Neural network for aproximation function for board game

    - by Pax0r
    I am trying to make a neural network for aproximation of some unkown function (for my neural network course). The problem is that this function has very many variables but many of them are not important (for example in [f(x,y,z) = x+y] z is not important). How could I design (and learn) network for this kind of problem? To be more specific the function is an evaluation function for some board game with unkown rules and I need to somehow learn this rules by experience of the agent. After each move the score is given to the agent so actually it needs to find how to get max score. I tried to pass the neighborhood of the agent to the network but there are too many variables which are not important for the score and agent is finding very local solutions.

    Read the article

< Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >