Search Results

Search found 34207 results on 1369 pages for 'query output'.

Page 26/1369 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • LINQ entity query performance

    - by Abdel Olakara
    Hi all, I have a silly question. I would like to know if there is performance deference in these two quries: var cObject = from cust in entities.Customer where cust.id == cid select cust; and var cObject = entities.Customer.First( c=> c.id == cid); My query return only one record as I am querying with the primary key. But do they make any difference?

    Read the article

  • Best way to check for NULL value in MySql query

    - by PHP-Prabhu
    Can any one please let me know the best way to use IF statement in mysql query to show if the "email" field is NULL then it should show as "no email"... Postcode Telephone Email ---------------------------------------------------------- BS20 0QN 1275373088 no email BS20 0QN 1275373088 no email PO9 4HG 023 92474208 [email protected] SO43 7DS 07801 715200 [email protected] ----------------------------------------------------------

    Read the article

  • Oracle Query for getting MAximum CTC (Salary) of Each Employee

    - by reply2viveksshah
    i want maximim CTC of each employee following is the design of my table Ecode Implemented Date Salary 7654323 2010-05-20 350000 7654322 2010-05-17 250000 7654321 2003-04-01 350000 7654321 2004-04-01 450000 7654321 2005-04-01 750000 7654321 2007-04-01 650000 i want oracle query for following out put Ecode Salary 7654321 650000 7654322 250000 7654323 350000 thanks in advance Vivek Shah

    Read the article

  • Converting a certain SQL query into relational algebra

    - by Fumler
    Just doing an assignment for my database course and I just want to double check that I've correctly wrapped my head around relational algebra. The SQL query: SELECT dato, SUM(pris*antall) AS total FROM produkt, ordre WHERE ordre.varenr = produkt.varenr GROUP BY dato HAVING total >= 10000 The relational algebra: stotal >= 10000( ?R(dato, total)( sordre.varenr = produkt.varenr( datoISUM(pris*antall(produkt x ordre)))) Is this the correct way of doing it?

    Read the article

  • SQL query for active users

    - by user344513
    This SQL query gives me today's number of users active in the last 30 days: SELECT COUNT(*) FROM table.users WHERE creation_tsz >= (now() - interval '30 days') How can I modify it to get not a single value, but a table of active users for a range of dates? Thanks, Rob

    Read the article

  • group by query issue

    - by user319088
    gorup by query issue i have one table, which has three fields and data. Name , Top , total cat , 1 ,10 dog , 2, 7 cat , 3 ,20 hourse 4, 4 cat, 5,10 Dog 6 9 i want to select record which has highest value of "total" for each Name so my result should be like this. Name , Top , total cat , 3 , 20 hourse , 4 , 4 Dog , 6 , 9 i tried group by name order by total, but it give top most record of group by result. any one can guide me , please!!!!

    Read the article

  • Mysql query trouble: uploading

    - by Jakub Zak
    I'm trying for last hour solve this problem. I have a long form and I'm trying to upload info into mysql database. Into table I made. This is the mysql query I'm using: mysql_query("INSERT INTO `users_temp`(`first_name`, `surname`, `birthday`, `nationality`, `email`, `mobile`, `landline`, `address`, `town`, `post_code`, `country`, `password`, `code_conf`) VALUES ([$f_name],[$s_name],[$bday],[$nationality],[$email],[$mobile],[$landline],[$address],[$town],[$post_code],[$country],[$pass],[$conf_code])"); If anyone see any problem why it doesn't work pls let me know. Thank you...

    Read the article

  • mysql query and index

    - by parm.95
    Does this query will be faster with a index on "t.type1" and "x.type1" or only index on "x.type1" is enought? SELECT t.id, x.id FROM t INNER JOIN x ON x.type1=t.type1 WHERE t.id=1

    Read the article

  • nhibernate intercept select query

    - by mjmcloug
    Hey, I'm looking at the nhibernate interceptor. It seems to be able to intercept save, update and delete queries but is there anyway I can intercept a select query. The problem I have is that I automatically want to append some additional sql filters to the executing sql statement in certain cases. Any thoughts Thanks Mat

    Read the article

  • PostGres if query?

    - by KnockKnockWhosThere
    Is there a way to select records based using an if statement? My table looks like this: id | num | dis 1 | 4 | 0.5234333 2 | 4 | 8.2234 3 | 8 | 2.3325 4 | 8 | 1.4553 5 | 4 | 3.43324 And I want to select the num and dis where dis is the lowest number... So, a query that will produce the following results: id | num | dis 1 | 4 | 0.5234333 4 | 8 | 1.4553

    Read the article

  • Best way to add a column in mysql query

    - by PHP-Prabhu
    Can any one please let me know that, I need to add a column dynamically when executing mysql query Table: Table1 -------------------------- col1 col2 col3 -------------------------- Test OK Test3 Test OK Test5 Test OK Test6 from the above example i need to introduce "col2" as new column and its value to be as "OK"

    Read the article

  • Optimize "not in" query

    - by Vasu
    Please help optimize this query: SELECT ts.SiteId, COUNT(ts.SiteId) AS Count FROM ts WHERE ts.SiteId not in (SELECT ts.SiteId FROM ts WHERE ts.uniqueid = 'xxx') GROUP BY ts.SiteId ORDER BY Count DESC

    Read the article

  • begin time and start time query

    - by shanks
    I have following data and using SQL Server 2005 UserID UserName LogTime LogDate 1 S 9:00 21/5/2010 1 S 10:00 21/5/2010 1 S 11:00 21/5/2010 1 S 12:00 21/5/2010 1 S 14:00 21/5/2010 1 S 17:00 21/5/2010 Need Output as:- 1 S 9:00 10:00 21/5/2010 1 S 11:00 12:00 21/5/2010 1 S 14:00 17:: 21/5/2010 I had used ROW_NUMBER function in query but its showing error

    Read the article

  • Mysql timestamp query

    - by Hulk
    In mysql a result of a query is say select timestamp from newbie; | 2010-03-12 14:50:46 | | 2010-03-12 14:50:46 | | 2010-03-12 14:50:51 | | 2010-03-12 14:50:52 | | 2010-03-12 14:50:54 | | 2010-03-12 14:51:04 | | 2010-03-12 14:51:07 | | 2010-03-12 14:51:08 | Is there a way to subquery the above and sum up the i.e, the final result should be the delta of each row in hh:mm:ss format

    Read the article

  • help with query in access

    - by Gold
    hi i have 2 tables Table A - code|name Table B - barcode|name table B has full barcode and name, Table A has only code i need to run update query that fill name in Table A i try somthing like: update A set name = (select top 1 Name from B where B.Code = mid(A.Barcode,1,8)) but it dos't work

    Read the article

  • PHP echo query result in Class??

    - by Jerry
    Hi all I have a question about PHP Class. I am trying to get the result from Mysql via PHP. I would like to know if the best practice is to display the result inside the Class or store the result and handle it in html. For example, display result inside the Class class Schedule { public $currentWeek; function teamQuery($currentWeek){ $this->currentWeek=$currentWeek; } function getSchedule(){ $connection = mysql_connect(DB_SERVER,DB_USER,DB_PASS); if (!$connection) { die("Database connection failed: " . mysql_error()); } $db_select = mysql_select_db(DB_NAME,$connection); if (!$db_select) { die("Database selection failed: " . mysql_error()); } $scheduleQuery=mysql_query("SELECT guest, home, time, winner, pickEnable FROM $this->currentWeek ORDER BY time", $connection); if (!$scheduleQuery){ die("database has errors: ".mysql_error()); } while($row=mysql_fetch_array($scheduleQuery, MYSQL_NUMS)){ //display the result..ex: echo $row['winner']; } mysql_close($scheduleQuery); //no returns } } Or return the query result as a variable and handle in php class Schedule { public $currentWeek; function teamQuery($currentWeek){ $this->currentWeek=$currentWeek; } function getSchedule(){ $connection = mysql_connect(DB_SERVER,DB_USER,DB_PASS); if (!$connection) { die("Database connection failed: " . mysql_error()); } $db_select = mysql_select_db(DB_NAME,$connection); if (!$db_select) { die("Database selection failed: " . mysql_error()); } $scheduleQuery=mysql_query("SELECT guest, home, time, winner, pickEnable FROM $this->currentWeek ORDER BY time", $connection); if (!$scheduleQuery){ die("database has errors: ".mysql_error()); // create an array } $ret = array(); while($row=mysql_fetch_array($scheduleQuery, MYSQL_NUMS)){ $ret[]=$row; } mysql_close($scheduleQuery); return $ret; // and handle the return value in php } } Two things here: I found that returned variable in php is a little bit complex to play with since it is two dimension array. I am not sure what the best practice is and would like to ask you experts opinions. Every time I create a new method, I have to recreate the $connection variable: see below $connection = mysql_connect(DB_SERVER,DB_USER,DB_PASS); if (!$connection) { die("Database connection failed: " . mysql_error()); } $db_select = mysql_select_db(DB_NAME,$connection); if (!$db_select) { die("Database selection failed: " . mysql_error()); } It seems like redundant to me. Can I only do it once instead of calling it anytime I need a query? I am new to php class. hope you guys can help me. thanks.

    Read the article

  • Timeout on Large mySQL Query

    - by Bob Stewart
    I have this query: $theQuery = mysql_query("SELECT phrase, date from wordList WHERE group='nouns'"); while($getWords=mysql_fetch_array($theQuery)) { echo "$getWords[phrase] created on $getWords[date]<br>"; } The data table "wordList" contains 75,000 records in the group "nouns" and every time I load the code I am returned an error. Help!

    Read the article

  • inserting array into database table in single query

    - by Praveen Prasad
    iam having an array of items like [item1,itmem2,item3]; i have to insert these items at a particular userId: final results look like this UserId ItemId 2 || item1 2 || item2 2 || item3 currently iam looping through the array in php code and inserting each item one by one eg foreach($items as $item) { insert into items (UserId,ItemId) value (2,$item); } is it possible i can insert all entries in single query.

    Read the article

  • Sql-server Database query help

    - by menacheb
    Hi, I have a project in C# with a Sql-server Database. In that database I have a table named 'Process' and columns named 'process_name', 'Full_Name' and 'Version' (all of the type:nvarchar(50)). I want to write a query wich will add the new process, only if it doesn't exist in the table yet. How can I do that? Many thanks,

    Read the article

  • SQLite Query to Insert a record If not exists

    - by Tharindu Madushanka
    I want to insert a record into a sqlite table if its actually not inserted. Let's say it has three fields pk, name, address I want to INSERT new record with name if that name not added preveously. Can we do with this in a single Query. Seems like its slightly different from SQL Queries sometimes. Thanks you, Tharindu Madushanka

    Read the article

  • CakePHP - Paginate / Query: find lowest of multiple fields & order by it

    - by Atea
    I am using CakePHP for a price-comparison website. I have a table products with fields: id, pride_regular, price_action. I would like to combine the fields price_regular and price_action into a dynamic field: price. The lowest value of these two fields should be the value of the new price field. Also I want to order on it Ascending. Should I use a custom MySQL-query?

    Read the article

  • What is the fastest findByName query with hibernate?

    - by Karussell
    I am sure I can improve the performance of the following findByName query of hibernate: public List<User> findByName(String name) { session.createCriteria(User.class).add(Restrictions.eq("name", name)).list(); } In which way should I improve it or even more important: in which ways should I improve it first? I will need the full object with all the collections (layz or not) and deps of this class.

    Read the article

  • MS Access query for time

    - by nisha
    following data and using MS Access with VB6 UserID UserName LogTime LogDate 1 S 9:00 21/5/2010 1 S 10:00 21/5/2010 1 S 11:00 21/5/2010 1 S 12:00 21/5/2010 1 S 14:00 21/5/2010 1 S 17:00 21/5/2010 Need Output as in below 6 columns:- 1 S 21/5/2010 9:00 21/5/2010 10:00 1 S 21/5/2010 11:00 21/5/2010 12:00 1 S 21/5/2010 14:00 21/5/2010 17:00

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >