Search Results

Search found 23261 results on 931 pages for 'case sensitive'.

Page 7/931 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Sql case that will use a current table

    - by Dana Ezer
    I have an sql statement that returns this result below,and I want that the num will drag the latest(by date) num that is not null. I can't get it right. I want to add somthing like this: case when num is null then max(num where date<my_date) my result now: Date num 1.1 0 2.1 1 3.1 NULL 4.1 NULL 5.1 4 what I want: Date num 1.1 0 2.1 1 3.1 1 4.1 1 5.1 4

    Read the article

  • mysql custom sorting first alpha then numeric using case when

    - by Nizzy
    How can you sort a query using ORDER BY CASE WHEN REGEXP? or other alternatives? I don't want to use UNION. Thank you mysql> SELECT `floor_id`, `floor_number` FROM `floors`; +----------+--------------+ | floor_id | floor_number | +----------+--------------+ | 1 | 4 | | 2 | 7 | | 3 | G | | 4 | 19 | | 5 | B | | 6 | 3 | | 7 | A | +----------+--------------+ Expected result: +----------+--------------+ | floor_id | floor_number | +----------+--------------+ | 7 | A | | 5 | B | | 3 | G | | 6 | 3 | | 1 | 4 | | 2 | 7 | | 4 | 19 | +----------+--------------+

    Read the article

  • MySQL: Use CASE/ELSE value as join parameter

    - by DRJ
    I'm trying to join the NAME and PHOTO from USERS table to the TRANSACTIONS table based on who is the payer or payee. It keeps telling me can't find the table this -- What am I doing wrong? SELECT name,photo,amount,comment, ( CASE payer_id WHEN 72823 THEN payee_id ELSE payer_id END ) AS this FROM transactions RIGHT JOIN users ON (users.id=this) WHERE payee_id=72823 OR payer_id=72823

    Read the article

  • Swapping switch-case in extra fle/data structure (Java)

    - by poeschlorn
    Hi guys, it may be a nooby question, but I've never needed it before: I have several strings and I want to compare them to given ones... At first glance it would lead to a switch/case construction in what every available entry is checked. Is there a more elegant way to swap those strings as key/value datas? greets, poeschlorn

    Read the article

  • Oracle Data Mining a Star Schema: Telco Churn Case Study

    - by charlie.berger
    There is a complete and detailed Telco Churn case study "How to" Blog Series just posted by Ari Mozes, ODM Dev. Manager.  In it, Ari provides detailed guidance in how to leverage various strengths of Oracle Data Mining including the ability to: mine Star Schemas and join tables and views together to obtain a complete 360 degree view of a customer combine transactional data e.g. call record detail (CDR) data, etc. define complex data transformation, model build and model deploy analytical methodologies inside the Database  His blog is posted in a multi-part series.  Below are some opening excerpts for the first 3 blog entries.  This is an excellent resource for any novice to skilled data miner who wants to gain competitive advantage by mining their data inside the Oracle Database.  Many thanks Ari! Mining a Star Schema: Telco Churn Case Study (1 of 3) One of the strengths of Oracle Data Mining is the ability to mine star schemas with minimal effort.  Star schemas are commonly used in relational databases, and they often contain rich data with interesting patterns.  While dimension tables may contain interesting demographics, fact tables will often contain user behavior, such as phone usage or purchase patterns.  Both of these aspects - demographics and usage patterns - can provide insight into behavior.Churn is a critical problem in the telecommunications industry, and companies go to great lengths to reduce the churn of their customer base.  One case study1 describes a telecommunications scenario involving understanding, and identification of, churn, where the underlying data is present in a star schema.  That case study is a good example for demonstrating just how natural it is for Oracle Data Mining to analyze a star schema, so it will be used as the basis for this series of posts...... Mining a Star Schema: Telco Churn Case Study (2 of 3) This post will follow the transformation steps as described in the case study, but will use Oracle SQL as the means for preparing data.  Please see the previous post for background material, including links to the case study and to scripts that can be used to replicate the stages in these posts.1) Handling missing values for call data recordsThe CDR_T table records the number of phone minutes used by a customer per month and per call type (tariff).  For example, the table may contain one record corresponding to the number of peak (call type) minutes in January for a specific customer, and another record associated with international calls in March for the same customer.  This table is likely to be fairly dense (most type-month combinations for a given customer will be present) due to the coarse level of aggregation, but there may be some missing values.  Missing entries may occur for a number of reasons: the customer made no calls of a particular type in a particular month, the customer switched providers during the timeframe, or perhaps there is a data entry problem.  In the first situation, the correct interpretation of a missing entry would be to assume that the number of minutes for the type-month combination is zero.  In the other situations, it is not appropriate to assume zero, but rather derive some representative value to replace the missing entries.  The referenced case study takes the latter approach.  The data is segmented by customer and call type, and within a given customer-call type combination, an average number of minutes is computed and used as a replacement value.In SQL, we need to generate additional rows for the missing entries and populate those rows with appropriate values.  To generate the missing rows, Oracle's partition outer join feature is a perfect fit.  select cust_id, cdre.tariff, cdre.month, minsfrom cdr_t cdr partition by (cust_id) right outer join     (select distinct tariff, month from cdr_t) cdre     on (cdr.month = cdre.month and cdr.tariff = cdre.tariff);   ....... Mining a Star Schema: Telco Churn Case Study (3 of 3) Now that the "difficult" work is complete - preparing the data - we can move to building a predictive model to help identify and understand churn.The case study suggests that separate models be built for different customer segments (high, medium, low, and very low value customer groups).  To reduce the data to a single segment, a filter can be applied: create or replace view churn_data_high asselect * from churn_prep where value_band = 'HIGH'; It is simple to take a quick look at the predictive aspects of the data on a univariate basis.  While this does not capture the more complex multi-variate effects as would occur with the full-blown data mining algorithms, it can give a quick feel as to the predictive aspects of the data as well as validate the data preparation steps.  Oracle Data Mining includes a predictive analytics package which enables quick analysis. begin  dbms_predictive_analytics.explain(   'churn_data_high','churn_m6','expl_churn_tab'); end; /select * from expl_churn_tab where rank <= 5 order by rank; ATTRIBUTE_NAME       ATTRIBUTE_SUBNAME EXPLANATORY_VALUE RANK-------------------- ----------------- ----------------- ----------LOS_BAND                                      .069167052          1MINS_PER_TARIFF_MON  PEAK-5                   .034881648          2REV_PER_MON          REV-5                    .034527798          3DROPPED_CALLS                                 .028110322          4MINS_PER_TARIFF_MON  PEAK-4                   .024698149          5From the above results, it is clear that some predictors do contain information to help identify churn (explanatory value > 0).  The strongest uni-variate predictor of churn appears to be the customer's (binned) length of service.  The second strongest churn indicator appears to be the number of peak minutes used in the most recent month.  The subname column contains the interior piece of the DM_NESTED_NUMERICALS column described in the previous post.  By using the object relational approach, many related predictors are included within a single top-level column. .....   NOTE:  These are just EXCERPTS.  Click here to start reading the Oracle Data Mining a Star Schema: Telco Churn Case Study from the beginning.    

    Read the article

  • Best practices for coding date sensitive websites

    - by Duopixel
    I'm creating a website for an event that is coming up. It has some functionality related to the event (such as "send me a reminder"), other stuff that takes place during the event, and finally some stuff that comes after the event. I need to start working on code that takes place during the event and after the event, plus some fixes for the current site (which is already live). What is the best way to approach this problem? Some solutions that occur to me are creating branches for each state and merging stuff as needed. Other one is hiding and showing functionality based on the date, i.e if (currentDate < eventDay) { reminder.show();}. Ideas?

    Read the article

  • How to make a system time-zone sensitive?

    - by Jerry Dodge
    I need to implement time zones in a very large and old Delphi system, where there's a central SQL Server database and possibly hundreds of client installations around the world in different time zones. The application already interacts with the database by only using the date/time of the database server. So, all the time stamps saved in both the database and on the client machines are the date/time of the database server when it happened, never the time of the client machine. So, when a client is about to display the date/time of something (such as a transaction) which is coming from this database, it needs to show the date/time converted to the local time zone. This is where I get lost. I would naturally assume there should be something in SQL to recognize the time zone and convert a DateTime field dynamically. I'm not sure if such a thing exists though. If so, that would be perfect, but if not, I need to figure out another way. This Delphi system (multiple projects) utilizes the SQL Server database using ADO components, VCL data-aware controls, and QuickReports (using data sources). So, there's many places where the data goes directly from the database query to rendering on the screen, without any code to actually put this data on the screen. In the end, I need to know when and how should I get the properly converted time? There must be a standard method for this, and I'm hoping SQL Server 2008 R2 has this covered...

    Read the article

  • Context Sensitive History. Part 1 of 2

    A Desktop and Silverlight user action management system, with undo, redo, and repeat. Allowing actions to be monitored, and grouped according to a context (such as a UI control), executed sequentially or in parallel, and even to be rolled back on failure.

    Read the article

  • Use Case Diagrams - should I create a diagram just for a view business rule?

    - by Periback
    I'm modeling a UCD where I have two actors ( a content producer and a developer).. the content producer is going to create and specify details of a storyboard functionality, and the other actor (developer) will only be able to view this storyboard ( he'll log in the application and read the storyboard to start developing what it says, outside the application..) I'm working on the specification of this storyboard functionality and I'd like to know it would be like a best-practice if I describe something like " actor- developer", "UCD - read scenes of storyboard" . This is the specification of an application I developed for my thesis and they asked me to add some specification...

    Read the article

  • Context Sensitive JTable (Part 2)

    - by Geertjan
    Now, having completed part 1, let's add a popup menu to the JTable. However, the menu item in the popup menu should invoke the same Action as invoked from the toolbar button created yesterday. Add this to the constructor created yesterday: Collection<? extends Action> stockActions =         Lookups.forPath("Actions/Stock").lookupAll(Action.class); for (Action action : stockActions) {     popupMenu.add(new JMenuItem(action)); } MouseListener popupListener = new PopupListener(); // Add the listener to the JTable: table.addMouseListener(popupListener); // Add the listener specifically to the header: table.getTableHeader().addMouseListener(popupListener); And here's the standard popup enablement code: private JPopupMenu popupMenu = new JPopupMenu(); class PopupListener extends MouseAdapter { @Override public void mousePressed(MouseEvent e) { showPopup(e); } @Override public void mouseReleased(MouseEvent e) { showPopup(e); } private void showPopup(MouseEvent e) { if (e.isPopupTrigger()) { popupMenu.show(e.getComponent(), e.getX(), e.getY()); } } }

    Read the article

  • Context Sensitive History. Part 2 of 2

    A Desktop and Silverlight user action management system, with undo, redo, and repeat; allowing actions to be monitored, and grouped according to a context (such as a UI control), executed sequentially or in parallel, and even to be rolled back on failure.

    Read the article

  • Django/MySQL - __istartswith not producing case-insensitive query.

    - by TheLizardKing
    I make use of generic views and I am attempting to query my MySQL db (utf8_bin collation) in a case insensitive manor to try to find all my song titles that start with a particular letter. view.py def tracks_by_title(request, starts_with): return object_list( request, queryset = Track.objects.filter(title__istartswith=starts_with), template_name = 'tlkmusic_base/titles_list.html', template_object_name = 'tracks', paginate_by = 25, ) and my urls.py urlpatterns = patterns('tlkmusic.apps.tlkmusic_base.views', (r'^titles/(?P<starts_with>\w)/$', tracks_by_title), ) the query it produces according to the django debug toolbar is: SELECT `tracks`.`id`, `tracks`.`url`, `tracks`.`artist`, `tracks`.`album`, `tracks`.`genre`, `tracks`.`year`, `tracks`.`title`, `tracks`.`comment`, `tracks`.`tracknumber`, `tracks`.`discnumber`, `tracks`.`bitrate`, `tracks`.`length`, `tracks`.`samplerate`, `tracks`.`filesize`, `tracks`.`createdate`, `tracks`.`modifydate` FROM `tracks` WHERE `tracks`.`title` LIKE a% LIMIT 1 specifically this line: WHERE `tracks`.`title` LIKE a% LIMIT 1 Why is it not ILIKE which is what I was expecting by using __istartswith? I am using Django 1.1.1 on Ubuntu.

    Read the article

  • DB2 CASE Statement

    - by gamerzfuse
    I need to somehow use the CASE syntax (which is beyond me) to affect the database results based on criteria. I have a bunch of royalties in 0.# form (royalty) I have a title ID # (title_id) and I need to show the new increase in royalties so that I can use the data. IF: they have a current royalty of 0.0 - 0.1 = 10% raise IF: they have 0.11 - 0.15 = 20% raise IF: royalty >= 0.16 = 20% raise Any help would be much appreciated. create table royalites ( title_id char(6), lorange integer, hirange integer, royalty decimal(5,2));

    Read the article

  • Why Switch/Case and not If/Else If?

    - by OB OB
    This question in mainly pointed at C/C++, but I guess other languages are relevant as well. I can't understand why is switch/case still being used instead of if/else if. It seems to me much like using goto's, and results in the same sort of messy code, while the same results could be acheived with if/else if's in a much more organized manner. Still, I see these blocks around quite often. A common place to find them is near a message-loop (WndProc...), whereas these are among the places when they raise the heaviest havoc: variables are shared along the entire block, even when not propriate (and can't be initialized inside it). Extra attention has to be put on not dropping break's, and so on... Personally, I avoid using them, and I wonder wether I'm missing something? Are they more efficient than if/else's? Are they carried on by tradition?

    Read the article

  • CASE + IF MysQL query

    - by terence6
    Problem is as follows. I have a product that can be in one of three categories (defined by category_id). Each category table has category_id field related to category_id in product table. So I have 3 cases. I'm checking If my product.category_id is in table one. If yes, I take some values. If not I check in tables that are left. What can I write In the ELSE section? Can anyone correct my query ? CASE WHEN IF EXISTS(SELECT * FROM table1 WHERE category_id='category_id') THEN SELECT type_id FROM table1 WHERE category_id='category_id'; WHEN IF EXISTS(SELECT * FROM table2 WHERE category_id='category_id') THEN SELECT value_id FROM table2 WHERE category_id='category_id'; WHEN IF EXISTS(SELECT * FROM table3 WHERE category_id='category_id') THEN SELECT group_id FROM table3 WHERE category_id='category_id'; ELSE "dont know what here"; END;

    Read the article

  • Help with MySQL and CASE WHEN with a range of values

    - by kickdaddy
    I have an accounts table and a records table where accounts have multiple records. I would like to break down the account totals by "count of records" range. i.e. show the breakdown of Count of Records | Count 0-25 | 100 25 - 50 | 122 50 - 100 | 300 etc. I am using the following query, but I can't get it to group by "grp" which is what I want, any help on the best way to modify query? Thanks! SELECT count(*) as ct, CASE WHEN COUNT(*) < 25 THEN '1-25' WHEN COUNT(*) >= 25 < 50 THEN '25-50' WHEN COUNT(*) >= 50 < 100 THEN '50-100' WHEN COUNT(*) >= 100 < 250 THEN '100-250' WHEN COUNT(*) >= 250 < 500 THEN '250-500' WHEN COUNT(*) >= 500 < 1000 THEN '500-1000' ELSE '1000+' END AS grp FROM records r,accounts a WHERE r.account_id=a.id ORDER BY ct

    Read the article

  • case insensitive highlighting in php

    - by fusion
    i'm using this function to highlight the results from mysql query: function highlightWords($string, $word) { $string = str_replace($word, "<span class='highlight'>".$word."</span>", $string); /*** return the highlighted string ***/ return $string; } .... $cQuote = highlightWords(htmlspecialchars($row['cQuotes']), $search_result); the problem is, if i type in 'good', it will only show my search results with a lower-case 'g'ood and not 'Good'. how do i rectify this?

    Read the article

  • Lucene case sensitive & insensitive search

    - by zvikico
    I have a Lucene index which is currently case sensitive. I want to add the option of having a case insensitive search as a fall-back. This means that results that match the case will get more weight and will appear first. For example, if the number of results is limited to 10, and there are 10 matches which match my case, this is enough. If I only found 7 results, I can add 3 more results from the case-insensitive search. My case is actually more complex, since I have items with different weights. Ideally, having a match with "wrong" case will add some weight. Needless to say, I do not want duplicate results. One possible approach is to have 2 indexes. One with case and one without and search both. Naturally, there's some redundancy here, since I need to index twice. Is there a better solution? Ideas?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >