Here is the SQL table: KEY | NAME | VALUE --------------------- 13b | Jeffrey | 23.5 F48 | Jonas | 18.2 2G8 | Debby | 21.1 Now, if I type: SELECT * FROM table WHERE VALUE = 23.5 I will get the first row. What I need to accomplish is to get the first
i have a code that display 3 questions and multiple answers from database for user to select. after choosing the answers user will hit the submit button. its works fine. Current Code: <?php $today=date("Y-m-d"); echo "<form method='po
I have a table with set of rows with same RecordtypeCode, then the single/set row coming from a flatfile/other source like below, finally I need a unique row in my table by elimating the duplicate Recordtypecode & taking the max of other field inform
How can i export table data with column name in text file in sql server 2005?safest way to do that is to backup data and then restore it on other server! right click on database in ms sql management studio>tasks>backup , choose directory to backup t
I'm writing an application that uses Mysql and for now my tables don't have many data in it. I want to test how my application handles a larger amount of data. In order to do that I need each row in the resultset to repeat itself several times. I kno
In CodeIgniter there is a function query->row_array which will give you an associative array of your result, mapping column names to values. However this function only works if there is a single row as a result. What I need is a function which will r
Sorry for the question (not for asking it, but for the way it's worded - I'm not... entirely certain how to ask it...). I'm running the following SQL statement: SELECT `U`.`user_id` AS `User_ID` /*A lot of irrelevant stuff*/ COUNT(`U`.`parent_id` = `
I have a MySQL table like below. ID NAME SURNAME 1 Joe Black 2 Mary Peterson 3 Bob Marley 4 Andy Murray ... I want to write a SELECT command which will return every row N times. Example for N = 3. SELECT NAME, SURNAME blah-blah (3 Times ) FROM Person
I am trying to return each row in my database as a separate array of information. At the moment I have only managed to return all rows in the database as a single array, but that is not what I want. My current code to do that is: $previous_info = arr
I am moving existing working queries from MySQL to MS SQL Server (version 11) and I am unable to convert one of the queries that is working fine on MySQL. It basically selects only distinct rows from the table considering 4 column values. Table is (w
I need to SELECT one row from first table and two rows from second one that correspond to the result from the first one. I can explain it more clearly using example. As shown below I have two tables. Table "Games" have information about games be
I have a table with a following data: ID | Name --------- 1 | John 2 | Alice And when I want to select 5 rows I want to get the next data: ID | Name --------- 1 | John 2 | Alice 1 | John 2 | Alice 1 | John Is there any ideas how to make this? -- to c
I have a self join result table which I have a lot of duplicated lines (because I have history on that table as well..). the result table is (date, date, varchar, int, int, int, int). how can I return only unique lines (where all of the columns ident
What would be the query to select one row with lowest numeric value of one column?You can use it SELECT * FROM `YourTable` ORDER BY YourColumn LIMIT 1