Search the Community
Showing results for tags 'order by'.
I have a diagram representing a database and need to find a way to update a given table with respect to information about elements in that table. Here is the database design: https://i.stack.imgur.com/HR6q2.jpg I have a Playlist defined which is called "Frank's Stuff" which is owned by the Customer Frank Harris. The question is the following: Update the playlist "Frank's Stuff" as a function of the track duration. Display this playlist with the TrackID, Name and Milliseconds to verify. I've read that you cannot use an ORDER BY statement with and UPDATE statement un
Hello internet, I am using the following calls to get an ordered list of largest to smallest info of all that row's data: *NOTE: there are only 6 entries in mydatabase with grp='c' $result = mysql_query("SELECT * FROM mydatabase WHERE grp='c' ORDER BY score DESC LIMIT 0,1", $con); $rows = array();while ($row = mysql_fetch_assoc($result))...... more code to place data into a specific id to use an onload to populate objects $result = mysql_query("SELECT * FROM mydatabase WHERE grp='c' ORDER BY score DESC LIMIT 1,1", $con); $rows = array();while ($row = mysql_fetch_assoc($result)).....
hi there, the following query was developed and works as it should. SELECT ( SELECT COUNT(DISTINCT SP1.bigint_ProspectID, PLS1.smallint_ProspectOrdinal) FROM 10_serviceprospects SP1 LEFT JOIN 13_prospectleadsent PLS1 ON SP1.bigint_ProspectID = PLS1.bigint_ProspectID WHERE PLS1.timestamp_Sent BETWEEN "2013-08-01 00:00:00" AND "2013-08-30 23:59:59" AND SP1.bigint_ServiceID = SS.bigint_ServiceID AND PLS1.bigint_SupplierID = S.bigint_SupplierID ) AS `Previous Month`, ( SELECT COUNT(DISTINCTROW SP2.bigint_ProspectID, PLS2.smallint_ProspectOrdinal) FROM 10_serviceprospec