order

Mysql Sort order very Weird

SELECT events.title FROM events ORDER BY events.title DESC I'm getting the proper ordering for all but a couple events at the end of my table. The encoding on the title table is utf8_general_ci. I've tried retyping the the title, hoping it was using some weird russian characters I couldn't see, but it still appears in the wrong order....

Default row ordering for select query in oracle

In Oracle, what is the the default ordering of rows for a select query if no "order by" clause is specified. Is it the order in which the rows were inserted there is no default ordering at all none of the above. ...

How do I find out out the fundamental operation when calculating run-time complexity?

Hi, I am trying to get the worst run-time complexity order on a couple of algorithms created. However I have run into a problem that I keep tending to select the wrong or wrong amount of fundamental operations for an algorithm. To me it appears to be that the selection of the fundamental operation is more of an art than a science. Afte...

How do I sort into a dynamically generated specific order in mySQL?

I've been beating my brains in over this and I'm making no progress. I'm not very good with SQL so I'm hoping the answer is something simple that I just don't know. I have 2 tables: One called "images" that contains the data I want, organized with a primary key "imageID". The other is called "productPhotos", and it contains two fields (...

Can I get the position of a record in a SQL result table?

If I do something like SELECT * FROM mytable ORDER BY mycolumn ASC; I get a result table in a specific order. Is there a way in SQL to efficiently find out, given a PK, what position in that result table would contain the record with my PK? ...

Can a C++ compiler re-order elements in a struct

Hi All, Can a C++ compiler (specifically g++) re-order the internal elements of a struct? I'm seeing some strange behaviour where I have a structure that contains something like the following: Struct SomeStruct{ ... ... long someLong; long someLongArray[25]; unsigned long someUnsignedLong; unsigned long someUnsignedL...

Row insertion order entity framework

I'm using a transaction to insert multiple rows in multiple tables. For these rows I would like to add these rows in order. Upon calling SaveChanges all the rows are inserted out of order. When not using a transaction and saving changes after each insertion does keep order, but I really need a transaction for all entries. ...

MySQL Group By ordering

Hi all, I have the following table: id time text otheridentifier ------------------------------------------- 1 6 apple 4 2 7 orange 4 3 8 banana 3 4 9 pear 3 5 10 grape 2 What I want to do is select ...

Looking for code to add 'featured' to particular number sequence

I was thinking of the best way of adding a class of 'featured' (in classic ASP), in this sequence of records from a DB: N,Y,Y,N,N,Y,Y The sequence is: 2 3 6 7 10 11 14 15 18 19... I already have a count (starting from 1 going for each record) Many thanks! ...

what's the default order by for this query in MYSQL?

mysql> explain SELECT p.id ID, p.job_desc_title Title, p.url URL, substr(p.posting_date, 1, 10) Date, -> p.job_city_name City, -> p.job_state_name State, -> b.screen_name Name, b.type Type,f.name Company,IF...

Asserting in NUnit that a collection is in the same order as an expected collection

I know how to check that a collection is ordered by some property: Assert.That(actual, Is.Ordered.By("Foo")); How can I assert that actual contains the elements (1,2,5,3,4) in this specific order (without writing a custom comparer). ...

The account of the contact on the order Microsoft CRM 4.0

When I create an order from a contact I want the account of the contact on the regarding field and not the contact. Because of that I created a code in the onload event which works very well. if ( (window.opener != null) && (window.opener.parent != null) && (window.opener.parent.document != null) && (window.opener.pare...

How can I to order an EntityQuery query in a seam app?

My project was originally generated by seam-gen and the action "List" bean, OfficeViewList looks pretty much like it did when first generated. The bean extends EntityQuery. Now I want to order the results. What is the best way to do this? Do I want to add some kind of "order by" class to my EJBQL? Or do I want to set the select order...

Why does compacting a Access 2000 db changes the order of records in a table?

As the question says. The table has no primary key defined. Other tables in the database do not change after compacting, and have as well no primary key defined. ...

MySQL: Sort GROUP_CONCAT values

In short: Is there any way to sort the values in a GROUP_CONCAT statement? Query: GROUP_CONCAT((SELECT GROUP_CONCAT(parent.name SEPARATOR " » ") FROM test_competence AS node, test_competence AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.id = l.competence AND parent.id != 1 ORDER BY parent.lft) SEPAR...

Compare two lists or arrays of arbitrary length in C#; order is important

Say I have two lists or arrays of strings. For example: list 1: "a", "c", "b", "d", "f", "e" list 2: "a", "d", "e", "f", "h" List 1 and list 2 are of arbitrary lengths. List 1 may contain elements not in list 2, and visa versa. I'd like to know when items in list 1 are found in list 2, and more specifically I want to know when an i...

Order of items being compared?

I've seen this around, but never heard a clear explanation of why... This is really for any language, not just C# or VB.NET or Perl or whatever. When comparing two items, sometimes the "check" value is put on the left side instead of the right. Logically to me, you list your variable first and then the value to which you're comparing....

How To Create a SQL Index to Import ORDER BY performance

Hi, I have some SQL similar to the following, which joins four tables and then orders the results by the "status" column of the first: SELECT * FROM a, b, c, d WHERE b.aid=a.id AND c.id=a.cid AND a.did=d.id AND a.did='XXX' ORDER BY a.status It works. However, it's slow. I've worked out this is because of the ORDER BY clause and ...

iphone UIScrollView reverse order positioning

Dear All, I'm building an app based upon the "Scrolling" sample code that Apple provided. All is working very well. The nature of the images that I want to display, would make it desirable, if the order of the images is reversed, and that the first visible image is the right-most, rather than the left most. Basically, the user should scr...

Ordering a list of objects by another object's property in C#

We have a system that is based around Events that Users are invited to [UserInvite]. Currently, I have a page that lists all the Users invited to an Event; they can be sorted by various properties, such as Surname [ascending and descending]. All fine and dandy, but now I'm required to additionally sort by a UserInvite property: DateEdit...