Recordset sort
I have a recordset (responders) that I would like to sort in
the following manner:
SELECT *
FROM responders
ORDER BY responders.COUNTRY, responders.`STATE`,
responders.CITY
After is construct the recordset, I test it and get good
results (clean).
When I run a test us the the sorted recordset in a program I
get the following result:
Warning: mysql_fetch_assoc(): supplied argument is not a
valid MySQL result resource in
/home/content/m/i/l/miltonembs/html/quik_classes/responder_master_unanswered.php
on
line 112
I would appreciate any help that I can get.
Milt
Thank you for your response.
I did notice the same thing and I reviewed the code generated
in the Dreamweaver program and found the references to 'STATE'. I
removed the '' from the code generated in the program and reran the
program and found that I received the same error. In addition, I
rewrote the entire line of code in the Recordset dialog box and it
also tested fine ( the table was reproduced in the proper order)
but the error message again reappeared when I OK'ed the recordset
dialog box and tested the updated program.
The problem has to be somewhere in the Dreamweaver code that
converts the recordset dialog input and places it into the program.
I am not a strong MySQL programmer either but I suspect that is not
where the problem is located. I have updated to 8.0.2 and I have
reviewed all of the known problems but I haven't run across
anything like this. It would seem that there would be an uproar
over this problem because I can't conceive of any one writing a
program that doesn't sort records by more than one field.
Thanks again for your kind effort.
Similar Messages
-
How do I pass a username form variable from a drop down list/menu to another page?
Hi,
I have a login_success.php page that has a drop down list/menu (which lists usernames). I want the user to click on their user name, and when they click the submit button the username information to be passed over to the username.php page which will contain a recordset, sorted by username.
How do I pass the username info from the drop down list/menu to the username.php page?
The drop down menu is connected to a recordset listUsername, I have filtered the recordset with the Form Variable = username, and I have used the POST method to send the username to the page username.php. I'm not sure how to structure the php or which page to place it on.
<form id="form1" name="form1 method="post" action="username.php">
<label for="username_id">choose username:</label>
<select name="username_id" id-"username_id">
<option value="1">username1</option>
<option value="2">username2</option>
<option value="3">username3</option>
<option value="4">username4</option>
</select>
<input type="submit" name="send" id="send" value="Submit" />
<input type="username" type="hidden" id="username" value="<?php echo $row_listUsername['username']; ?>" />
</form>
Could somebody help me please?
Thanks.I would not post the variable over, In this case I personally would send it through the URL and use the $_GET method to retreve it. For Example.
<html>
<head>
<title>Test Page</title>
<script type="text/javascript">
function userID(){
//var ID = form1.userIDs.selectedIndex;
var user = form1.userIDs.options[form1.userIDs.selectedIndex].value;
window.location = "test.html?userID=" + user;
</script>
</head>
<body>
<form id="form1">
<select name="userIDs" id="userIDs" onchange="userID();">
<option>Select a User</option>
<option value="1">User 1</option>
<option value="2">User 2</option>
<option value="3">User 3</option>
<option value="4">User 4</option>
</select>
</form>
</body>
</html>
//PAGE TO RETRIEVE THE USERNAME
<?php
if(isset($_GET['userID'])
$userID = $_GET['userID'];
echo $userID;
die; -
Adding a graphical display of vendor locations
Sorry this is going to be long winded !! I'm looking for some direction here on how to accomplish some graphical effectson rovements to a web page.
I have a website for an airshow where multiple (50+) vendors will each have booths (10ft x 10ft). Some vendors will have two booths adjacent to each other. Vendors already apply online and their info is stored in a single MySQL table with an additional text column showing the booth number assigned by the airshow administrator. I made this a text column so the administrator can enter for example booth number "27" for a single booth or booth numbers "27 & 28" or "27, 28" for multiple booths.
My initial idea was just to display an static image of the vendor area with booth numbers on it and below it to display two tables, one showing vendor names with the booth number assigned and a second showing the same info but in booth number order. I know how to do this using recordsets sorted by vendor name and booth number) and this approach is probably adequate. So, I thought I should try and improve it !!
First improvement would be to add a rollover effect so moving the mouse over the vendor area image would cause a pop-up to display the vendor name. Can I use dynamic data in the pop-up box and if so will I have to use a spry dataset to get an adequate response time, or does PHP cause all the pop-ups to be loaded when the page loads? Also, how would I address the issue of vendors with two, or possible more, booths. Each vendor only has one entry in the vendor table with multiple booth numbers in the text location field.
Second improvement would be to give the airshow administrator the ability to assign a vendor to a booth by clicking on a booth on the image of the vendor area.
My gut tells me either of these will be challenging for a neophyte like me doing this on a volunteer basis, but if there's a simple way of doing it I'd like to try.
Thanks for reading this far and for any suggestions.
Tonyhow would I address the issue of vendors with two, or possible more, booths. Each vendor only has one entry in the vendor table with multiple booth numbers in the text location field.
Use two tables (one for users, one for vendor tables) with JOIN argument to join multiple vendor tables for one vendor based off unique ID of vendor.
TABLE1_users:
id, name, email, phone, etc.
TABLE2_tables
id, user_id, table_number, table_img, table_img_rollover
With image 1 and image 2 location stored in db you can use any rollover script you want and simply replace image1.jpg with phpvariable_for_image1.jpg and image2.jpg with phpvariable_for_image2.jpg, respectively. -
Attempting to sort recordset off our iseries
I have a problem that I would appreciate assistance with. I have successfuly created a recordset that pulls data off our iSeries. I have created a table from the recordset, but upon the review of the content of the table by meeting attendees it was suggested that all columns of the table be sortable. In the past I had used a routine (free for the taking from www.easycfm.com), whereby <cfswitch> is used for sorting purposes. The SQL portion of the tutorial follows. However, while it runs against a MS access database, it has problems with the iSeries. In working with the Starquest people today (vendor for StarSQL) we ran a debug trace and it was observed that for this particular SQL statement, the ORDER BY clause is getting cutting off. Note the truncation that occurs right after Order BY in the following trace result.
trace result, "WHERE RTYPE = 8 AND RNCTL <> 'Y' AND RRLDTC > 0 AND RRLDTC <= 20090633 AND RESWT <= 5000 ORDER BY".
I also tried a query of the query. This too failed when I tried the dynamic sort SQL using <cfswitch>. The error that I received upon running that QOQ was that the ORDER BY was too complex.
Does anyone have any insight on how I might address the dynamic sorting of the recordset off the iSeries? Thanks!
Example SQL that I used:
<cfquery name="name went here" datasource="datasource went here">
SELECT *
FROM Table
ORDER BY
<cfswitch expression="#sort#">
<cfcase value="1">Field1</cfcase>
<cfcase value="2">Field1 desc</cfcase>
<cfcase value="3">Field2</cfcase>
<cfcase value="4">Field2 desc</cfcase>
</cfswitch>
</cfquery>NVL-Tom wrote:
However, while it runs against a MS access database, it has problems with the iSeries. ... we ran a debug trace and it was observed that for this particular SQL statement, the ORDER BY clause is getting cutting off.
The datasource type really has nothing to do with how ColdFusion generates that sql string. ColdFusion first evaluates the cfswitch/cfcase statements, then sends the final sql string to the chosen datasource. So it produces the same string no matter the datasource type.
What is more likely is that your #sort# value did not match any of the cfcase values. Since there is no default case, nothing is added to the ORDER BY, making it seem like the statement was truncated. -
I am aware that if you would like to sort records by 2
fields, you list both fields separated by a comma after ORDER BY
(i.e. ORDER BY Name, Date)
With the above code, the only way records will sort by Date
is if they are identical other than by their date.
Now what if I would really like to do is first sort records
that share a common Name value regardless of other field values and
then sort by Date ( Something like "First ORDER BY Name which
contains the value of "PC" and then ORDER BY Date DESC")
Can this be done?You can use a CASE statement in the ORDER BY clause.
"aonefun" <[email protected]> wrote in
message
news:g7fvjq$qgs$[email protected]..
>I am aware that if you would like to sort records by 2
fields, you list
>both
> fields separated by a comma after ORDER BY (i.e. ORDER
BY Name, Date)
>
> With the above code, the only way records will sort by
Date is if they are
> identical other than by their date.
>
> Now what if I would really like to do is first sort
records that share a
> common Name value regardless of other field values and
then sort by Date (
> Something like "First ORDER BY Name which contains the
value of "PC" and
> then
> ORDER BY Date DESC")
>
> Can this be done?
> -
How to sort database record in an Ascending or Descending order
First script below is on Initialize the second on Validate. I need the database to sort on an ascending order. I tried using the order by script in RED below to the Validate script but to no avail. Any help would be greatly appreciated.
$sourceSet.DataConnection2.#command.query.select.nodes.item(0).value = Concat("Select * from brw.ps_m_ee_genl_data Where FULL_NAME = ", Ltrim(Rtrim(SelectField.rawValue)) , " order by FULL_Name asc")
form1.#subform[0].SelectField::initialize - (JavaScript, client)
/* This listbox object will populate two columns with data from a data connection.
sDataConnectionName - name of the data connection to get the data from. Note the data connection will appear in the Data View.
sColHiddenValue - this is the hidden value column of the listbox. Specify the table column name used for populating.
sColDisplayText - this is the display text column of the listbox. Specify the table column name used for populating.
These variables must be assigned for this script to run correctly. Replace <value> with the correct value.
var
sDataConnectionName = "DataConnection2"; // example - var sDataConnectionName = "MyDataConnection";
var
sColHiddenValue = "FULL_NAME"; // example - var sColHiddenValue = "MyIndexValue";
var
sColDisplayText = "EMPLID"; // example - var sColDisplayText = "MyDescription"
// Search for sourceSet node which matchs the DataConnection name
var
nIndex = 0;
while
(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName){
nIndex
++;}
var
oDB = xfa.sourceSet.nodes.item(nIndex);oDB.open();
oDB.first();
// Search node with the class name "command"
nIndex
= 0;
while
(oDB.nodes.item(nIndex).className != "command"){
nIndex
++;}
// Need to set BOF and EOF to stay
oDB.nodes.item(nIndex).query.recordSet.setAttribute("stayBOF"
, "bofAction");oDB.nodes.item(nIndex).query.recordSet.setAttribute("stayEOF"
, "eofAction");
// Search for the record node with the matching Data Connection name
nIndex
= 0;
while
(xfa.record.nodes.item(nIndex).name != sDataConnectionName){
nIndex
++;}
var
oRecord = xfa.record.nodes.item(nIndex);
// Find the value node
var
oValueNode = null;
var
oTextNode = null;
for
(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++){
if(oRecord.nodes.item(nColIndex).name == sColHiddenValue){
oValueNode
= oRecord.nodes.item(nColIndex);}
else if(oRecord.nodes.item(nColIndex).name == sColDisplayText){
oTextNode
= oRecord.nodes.item(nColIndex);}
while
(!oDB.isEOF()){
this.addItem(oValueNode.value
, oValueNode.value);
//IDList.addItem(oValueNode.value, oTextNode.value);
oDB.next();
// Close connection
oDB.close();
form1.#subform[0].SelectField::validate - (FormCalc, client)
if (Len(Ltrim(Rtrim(SelectField.rawValue))) > 0) then
//Change the commandType from TABLE to TEXT. TEXT is the equivalent of SQL Property
$sourceSet.DataConnection2.#command.query.commandType= "text"
//Set the Select Node. Select in this case will be whatever the SQL Property you want.
$sourceSet.DataConnection2.#command.query.select.nodes.item(0).value= Concat("Select * from brw.ps_m_ee_genl_data Where FULL_NAME = ", Ltrim(Rtrim(SelectField.rawValue)) , "")
//Reopen the Dataconnection
$sourceSet.DataConnection2.open()endifThis is in Mavericks, but I think it also applies to the Finder in Lion.
View menu / Arrange by / Name. -
Sorting for the procedure is not working
can you help why the sorting is not working here.I am running the below procedure to sort asc and desc and when I do sort in descending order by a different column it gives me a different rows sorted in desc order. what i
want the proecdure to do it to sort the recordset in asc and desc order without changing the selected rows
SQL> exec trnsportitems.gettrnsportitems(1,10,'itemnumber desc', :n, :c);
PL/SQL procedure successfully completed.
SQL> print c;
ITEMNUMBER R IDESCR IDESCRL IUNI IS I ITEM
2011.601/00002 1 TUNNEL CONSTRUCTION LAYOUT STAKING TUNNEL CONSTRUCTION LAYOUT STAKING LS 0
2011.601/00003 2 CONSTRUCTION SURVEYING CONSTRUCTION SURVEYING LS 05 N 2011601/00003
2011.601/00010 3 VIBRATION MONITORING VIBRATION MONITORING LS 05 N 2011601/00010
2011.601/00020 4 REVISED BRIDGE PLANS REVISED BRIDGE PLANS LS 05 N 2011601/00020
2011.601/00040 5 DESIGN DESIGN LS 05 N 2011601/00040
2011.601/00050 6 DESIGN AND CONSTRUCT DESIGN AND CONSTRUCT LS 05 N 2011601/00050
2011.601/08010 7 SUPPLEMENTAL DESCRIPTION SUPPLEMENTAL DESCRIPTION LS 05 N 2011601/08010
2011.601/08011 8 SUPPLEMENTAL DESCRIPTION SUPPLEMENTAL DESCRIPTION LS 05 N 2011601/08011
2011.601/08012 9 SUPPLEMENTAL DESCRIPTION SUPPLEMENTAL DESCRIPTION LS 05 N 2011601/08012
2011.601/08013 10 SUPPLEMENTAL DESCRIPTION SUPPLEMENTAL DESCRIPTION LS 05 N 2011601
10 rows selected.
SQL>
SQL> exec trnsportitems.gettrnsportitems(1,10,'idescr DESC', :n, :c);
PL/SQL procedure successfully completed.
SQL> print c;
ITEMNUMBER R IDESCR IDESCRL IUNI IS I ITEM
2563.613/00040 1 YELLOW TUBE DELINEATORS YELLOW TUBE DELINEATORS UDAY 05 N 2563613/00040
2563.602/00100 2 YELLOW TUBE DELINEATOR YELLOW TUBE DELINEATOR EACH 05 N 2563602/00100
2565.602/00940 3 YELLOW LED INDICATION YELLOW LED INDICATION EACH 05 N 2565602/00940
2502.602/00040 4 YARD DRAIN YARD DRAIN EACH 05 N 2502602/00040
2411.601/00030 5 WYE STRUCTURE WYE STRUCTURE LS 05 N 2411601/00030
2557.603/00041 6 WOVEN WIRE FENCE WOVEN WIRE FENCE L F 05 N 2557603/00041
2557.603/00043 7 WOVEN WIRE WOVEN WIRE L F 05 N 2557603/00043
2563.613/00615 8 WORK ZONE SPEED LIMIT SIGN WORK ZONE SPEED LIMIT SIGN UDAY 05 N 2563613/00
2563.613/00610 9 WORK ZONE SPEED LIMIT WORK ZONE SPEED LIMIT UDAY 05 N 2563613/00610
2557.603/00035 10 WOODEN FENCE WOODEN FENCE L F 05 N 2557603/00035
10 rows selected.Hi,
user13258760 wrote:
can you help why the sorting is not working here.I am running the below procedure to sort asc and desc and when I do sort in descending order by a different column it gives me a different rows sorted in desc order. what i
want the proecdure to do it to sort the recordset in asc and desc order without changing the selected rowsAs it is written now, the argument insortexp has nothing to do with the order of the rows. It is used only in computing column r, and column r is used only in the WHERE clause.
Are you really saying you don't want a WHERE clause at all in the main query: that you always want the cursor to contain all rows from itemlist that meet the 3 hard-coded conditions:
... WHERE item '2999509/00001' -- Did you mean != here?
AND iobselet = 'N'
AND ispecyr = '05'?
If so, change the main query WHERE clause:
WHERE r BETWEEN instartrowindex AND inendrowindexinto an ORDER BY clause:
ORDER BY rBy the way, you might want to make insortexp case-insensitive.
In your example, you're calling the procedure with all small letters in insortexp:
user13258760 wrote:
SQL> exec trnsportitems.gettrnsportitems(1,10,'itemnumber desc', :n, :c);but the output is coming in ASC ending order:
... ORDER BY
DECODE (insortexp, 'itemnumber ASC', item) ASC,
DECODE (insortexp, 'itemnumber DESC', item) DESC, -- capital 'DESC' won't match small 'desc'
DECODE (insortexp, 'idescr ASC', idescr) ASC,
DECODE (insortexp, 'idescr DESC', idescr) DESC,
DECODE (insortexp, 'idescrl ASC', idescrl) ASC,
DECODE (insortexp, 'idescrl DESC', idescrl) DESC,
DECODE (insortexp, 'iunits ASC', iunits) ASC,
DECODE (insortexp, 'iunits DESC', iunits) DESC,
DECODE (insortexp, 'ispecyr ASC', ispecyr) ASC,
DECODE (insortexp, 'ispecyr DESC', ispecyr) DESc,
SUBSTR (item, 1, 4) || '.' || SUBSTR (item, 5) -- This is the only non-NULL ORDER BY expression Why not declare a local variable:
sortexp VARCHAR2 (20) := LOWER (insortexp);and use that variable instead of the raw argument in the query:
... DECODE (sortexp, 'itemnumber asc', item) ASC,
DECODE (sortexp, 'itemnumber desc', item) DESC, ...Also, this site doesn't like to display the <> operator, even inside \ tags. When posting here, always use the other inequality operator, !=
Edited by: Frank Kulash on Jun 15, 2010 3:25 PM -
To create a sort of "browse the pages" in a page with DWCS6: how?
Hello all again,
as usual i'm here with something that for me seems impossible and maybe it's super easy... i checked online but i couldn't find any answer. I start with a description of what i want to accomplish:
- i have 1 database (mySQL) with a table called "Books", inside i have these fields: Title (VARCHAR 60), Author (VARCHAR 20), StoryText (LONGTEXT)
- i have 1 page for me, where i insert with a form a book when i want to update the DB
- i have 2 PHP pages, one that has links where the user chooses, for example, the name of a book and the other that gets that name from the URL and show the content (x chapters of the story, tale or whatever)
- i'm the user and i click on the link "The Little Prince", the page loads and shows me the title, the author, the text of x chapters (let's say 4 chapters)
- that text has to be "divided" in more than one page because it's too long for a single page, so i want to see something like:
Example when you enter the page:
The Little Prince
Once upon a time......
Page 1 | >> | Last page
and example when you reach page 9:
The Little Prince
The little prince....
First page | << | Page 9 | >> | Last page
All of this has to be in a single page though, no links to somewhere else or so. It's not a page itself but it appears in a PHP page like a table, textarea and so on. The closer thing i can think about it's a photogallery, where you press left and right and shows the pics but here, instead of pics, there's text. And if possible, i wouldn't want to create a table in my database everytime i insert a new book. What i'd like it's something that "splits" the text i have in a field called "StoryText" (table "Books") and let the user browse the pages. If i have, for example, a book 1000 lines long, i want to make a page every 50 lines so i get 20 pages. Those 20 pages need to get a sort of recordset navigation bar but... not about a recordset, only about a text in that page.
Resuming, what i need is:
- a way to split long text in x pages (like the example, 1 page every 50 lines of text)
- add a navigation bar or some sort of control to browse those pages
Is it possible something like that? Thanks.The example below shows you how to split the article into pages using [PAGEBREAK] inserted into the database but it only gives you the option of NEXT | PREVIOUS
Split article into multiple pages
I'm positive you can do exactly what you require - it's a matter of finding and piecing the code together. Entering [PAGEBREAK] into the database isn't very practical either. I'd be looking for an example that extracted a certain number of words. -
Hi all
I have scenario where a file comes in and we need to sort by 4 fields branch/date/tran-code/tran_no?
After we sort the file we need a context change to see what line items belong together and return the correct value for that fields in the line item.
RegardsHi,
I thing your source structure like below.
<Recordset>
<Structure>
<Structure>
<Recordset>
<Structure>
<Recordset>
<Structure>
That time only you get the context change as per your structure.
Map like below..It will solve your problem.
(recordset)---->Change the context to Recordset
branch(Recordset)---
date(Recordset)---concat--
tran-code(Recordset)------concat--
tran_no(Recordset)----------------concat--sort(Lexicographical(case insensitive),ascending)-------
---Collapsecontext--E1BPACCR08
branch(Recordset)---
date(Recordset)---concat--
tran-code(Recordset)------concat--
tran_no(Recordset)----------------concat--sort(Lexicographical(case insensitive),ascending)--Item
branch(Recordset)---
date(Recordset)---concat--
tran-code(Recordset)------concat--
tran_no(Recordset)----------------concat--sortByKey(Lexicographical(case insensitive),ascending)---
-----------------------------------------------------------------------------------SplitByValue(EachValue)--AMT_DOCCUR
Amt(Recordset)----------------------------
Regards,
Prakasu.M -
View entire dataset after non destructive sorting.
So I have a page that calls a large number of records and I allow the user to narrow the choices down using a standard non destructive filter in a text box. I return the results in a repeating tr table. The recordset contains maybe 15 datapoints be row. I only show them about 6 on this page since the rest is not that meaningful or wouldnt be searchable. Howver, once the user sorts this data down I would like them to see the entire filtered dataset in a table or something for exporting to excel. How do I access that newly filtered dataset in its entirety? Do I have to write it out like I am doing this visible table or is there some secret weapon for me to get this newly sorted stuff?
Thanks.
JonA URL to your page will be helpful.
Gramps -
(PHP/MySql) Create Recordset but no column
Thanks for reading this, I am new to PHP/MySql
I have created a website www.ritchiecraft.co.uk which uses
PHP/MySql with Dreamweaver 8. I have created recordsets on most
items pages and filtered data as neccessary. After the site was up
and running I was required to insert a new topic and when I went to
create a new page and insert the recordset no data was placed in
the columns area and the filter/sort options were greyed out. I
checked the existing pages and found that this was happening to all
pages with recordsets. The connection, table data was there.
The site still works fine but I cannot introduce new pages or
edit existing because of the recordset problem. I was advised
previously to delete the Dreamweaver cache file but this did not
help.
The site is hosted commercially and the database was created
with phpMyAdmin and dont seem to have any connection problems.
Thanks for your time and any suggestions are welcome.sweetman wrote:
> How can I set a query so that it sounds like this:
>
> SELECT $_GET['id'] FROM mytable ORDER BY myorder ASC?
You can't do it through the Recordset dialog box. The simple
way to do
it is to create this query in the Recordset dialog box:
SELECT * FROM myTable
ORDER BY myOrder ASC
Then go into Code view and locate the following line:
$query_recordsetName = "SELECT * FROM myTable ORDER BY
myOrder ASC";
Change it to this:
if (isset($_GET['id'])) {
$col = get_magic_quotes_gpc() ? stripslashes($_GET['id']) :
$_GET['id'];
$col = mysql_real_escape_string($_GET['id']);
else {
$col = '*';
$query_recordsetName = "SELECT $col FROM myTable ORDER BY
myOrder ASC";
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Different results for decimal values between SQL and B1 RecordSet
Hi Experts,
This is really a strange one. I have the query below:
SELECT Amount, TaxPrcnt FROM [@Table] WHERE ORDER# = '20246' AND ItemCode = '112488'
The same query gives me 0.085 for TaxPrcnt if I run it in SQL Management Studio, but gives me 8.5 if I run it in B1 Query Generator, and the same if I use RecordSet object in DI. The actual value in the table is 0.085. Anyone know why B1 is multiplying the value by 100?Hi Ronnie,
sp_prepexec is a system stored procedure used to generate to prepare and execute a parameterized SQL statement. Have a look at:
http://jtds.sourceforge.net/apiCursors.html#_sp_prepexec
Basically, it's another way of passing a query to SQL rather than using a stored procedure. This command shouldn't be converting the data in any way, unless there's a specific cast or calculation in the query itself.
Can you give simple details of the SQL table you created and I'll see if I can replicate the issue.
Kind Regards,
Owen
P.S. Sorry about the query, I wrote that down this morning before all my brain cells were awake Referencing a field by index only works when grouping and sorting. -
Default Sorting behaviour of Oracle 9i in 11g along with group by clause
Hi,
We have recently migrated from 9i to 11g. The reports from application comes in a jumbled fashion. Later we understood when there is a group by clause in the query, the recordset will be sorted by default in 9i and this feature is not available in 11g. Do anyone faced the same issue and resolved at the DB level.
Only alternate we found is the change in code with addittional order by clause which will take a long time to complete and roll out the same.
If anyone has got any immediate solution, please let me know.
Thx in advance.
SheenHi,
A group by can sort (depending on the method of grouping) but it isn't necessary. If you want to sort the output you need the ORDER BY clause. There are different group by mechanismes between 9i and 11g. 10g introduced HASH GROUP BY where in 9i only the SORT GROUP BY existed. The latter gives a sorted set, the first not.
if you want the same behaviour you can use "_gby_hash_aggregation_enabled parameter" = false, which disables the hash group by.
Have also a look at the support document "'Group By' Does Not Guarantee a Sort Without Order By Clause In 10g and Above [ID 345048.1]".
Herald ten Dam
http://htendam.wordpress.com -
How to change to order of sorter
If I use Move up/down column
the list page will order by ascending by the sort field, that mean the latest data will be in the last page, therefore I want to change the order
I found some code seems related to the sort function
$tso_listdrama_ship_main1 = new TSO_TableSorter("rsdrama_ship_main1", "tso_listdrama_ship_main1");
$tso_listdrama_ship_main1->addColumn("drama_ship_main.sm_sort DESC"); // Order column
$tso_listdrama_ship_main1->setDefault("drama_ship_main.sm_sort DESC");
$tso_listdrama_ship_main1->Execute();
// Defining List Recordset variable
$NXTSort_rsdrama_ship_main1 = "drama_ship_main.sm_sort DESC";
if (isset($_SESSION['sorter_tso_listdrama_ship_main1'])) {
$NXTSort_rsdrama_ship_main1 = $_SESSION['sorter_tso_listdrama_ship_main1'];
I add DESC after all the sort field, but it's not work.Hi Jason,
How to change the order of tables within sheets
Make a table active by clicking in it once to select that table, then drag it by the 'bullseye' (top left, I have placed a red circle to show the bullseye):
After dragging the table down:
Table 1 is now below Table 2.
The blue line is an Alignment Guide
Two types of Guide:
1. Menu > View >Show Rulers. Drag Alignment Guides from a ruler to where you want them.
2. Menu > Numbers > Preferences > Rulers > Alignment Guides. Turn on (tick) both guides. That allows you to align objects with *each other* (as well as with the ruler guides). These guides help to align objects left, middle, right, top, bottom.
Alignment Guides do not show unless you are moving an object.
to drag/move table to another sheet in the one file
Not possible in Numbers 3. The Sheets Pane has gone. Instead, select the entire table (click once in the table to make it active, then click on the bullseye). Copy (or Cut if you are brave). Go to another Sheet and Paste.
Also can you change the size of sheet tab width on tab toolbar, so I can see more sheets at once??
No. Let's hope this will be added in future updates. However, you can drag a Sheet tab left or right to reorder them.
Another tip: each Sheet tab shows the contents of that Sheet, with some options such as Duplicate and Delete:
Regards,
Ian. -
How to write select option 'onchange' to sort by?
From a previous thread, David Powers helped me write an array to use to sort from a list/menu of columns from a recordset
$permitted = array('price', 'area');
// check whether the sort_menu variable contains a valid column name
if (isset($_GET['sort_menu']) && in_array($_GET['sort_menu'], $permitted)) {
$sort = $_GET['sort_menu'];
} else {
// set a default column for sorting
$sort = 'price';
?>
This assumes that the columns for sorting are called price and area.
Change these values to suit your setup.
Now you can add ORDER BY $sort to the SQL in the recordset.
I use this with a submit button.
i want to use the 'onchange' feature of the select option and do away with the submit button.
what goes after onchange=" what goes here? "
this is the sql query
"SELECT * FROM rentals_info WHERE rentals_info.active = 'yes' ORDER BY $sort ASC";That's a JavaScript problem. A quick Google search for "sort table columns javascript" brought up the following tutorial that seems to do very much what you want: http://www.kryogenix.org/code/browser/sorttable/.
Maybe you are looking for
-
Returns, Credit Memo, Credit Memo Request
Hi All, Can anybody clear my doubts for the below mentioned and i would require the process flow please with Transactions and Order Type, Billing Type etc. Booking goods returned Credit note with stock receipt Credit note without stock receipt Va
-
Cannot make Canon PIXMA MX922 fax to work with "Windows Fax And Scan" on Windows 7, 8.1
I have Canon PIXMA MX922 multifunction printer installed wireless on iMac OS X Mavericks. It works great but there is no fax drivers for Mac. I have Windows 7 and Windows 8.1 installed on Parallel Desktop. I am able to print and scan on these machine
-
Help! problems upgrading itunes,wont play at all now!
hi, ive just recently upgraded itunes after a prompt to do so and now i cant play itunes at all.All i get is a message saying itunes has encountered a problem and needs to close.I have tried de-installing and reinstalling,my computer is clean but i j
-
Difficulty installing Micosoft Communicator on my 8800.
Difficulty installing Micosoft Communicator on my 8800.
-
I am getting mysterious freezes while working in Logic or ProTools. Sometimes the clock is still ticking in my menu bar, but cursor and QWERTY are useless. I suspect a USB problem. But how do I make it so the crashes are logged somewhere, so I can sh