Can someone provide me a code sample to query Bios Serial number and CPU id using WMI in C++.
I did search for a solution, here but couldn't find a good one.
thanks in advance.
I have a doubt. Assume R and S are 2 relations with attributes A and B respectively . If I have a query
Select *
From R, S
Where R.A = S.B
Does this work like a double For Loop in say c or c++
For( i=0; i<n; i++)
For( j=0; j<n; j++)
if (i == j)
//DO some work
I want to list records with a particular month and year. The table name is 'Arrival' and 'date' is the field that stores the date that the record was added. This is to be done from a C# application. For example, if the user selects month as 'April' and year as '2009' in the application, it will list all the records that were added on April,2009. (I only need the query, hope I can figure out the rest :) )
I have a email address like [email protected] and [email protected][email protected] ... etc
I want a Mysql select query so that it would trim user names and .com an returns output as
gmail,ymail,hotmail etc
hi
i need to search between date's and time's.
for example: between date: 30/02/2007 time: 10:32 and date: 21/06/2008 time: 14:19
what is the most simple query for this ?
thank's in advance
So, I want to retrieve the order of the elements of a list. The order is set before by the user, and are stored in the table below. Because I also want to retrieve name and description of the list elements I need to combine two tables (see below).
However, what is actually retrieved is an array containing 16 elements (should be four because it only exists four elements as for now). The array is too long to post here, but I put it in a phpFiddle to be found here if you're interested.
Well, I have really tried to find what's wrong (probably something easy as always), but with no luck.
Thanks a lot for your time and help!
listModel.php:
public function GetOrderedElements($userId, $listId) {
// $userId = 46
// $listId = 1
$query = "SELECT le.listElemId, le.listElemName, le.listElemDesc, lo.listElemOrderPlace
FROM listElement AS le
INNER JOIN listElemOrder AS lo
ON le.listId = lo.listId
WHERE lo.userId = ?
AND lo.listId = ?
ORDER BY listElemId";
$stmt = $this->m_db->Prepare($query);
$stmt->bind_param("ii", $userId, $listId);
$listElements = $this->m_db->GetOrderedElements($stmt);
return $listElements;
}
database.php:
public function GetOrderedElements(\mysqli_stmt $stmt) {
if ($stmt === FALSE) {
throw new \Exception($this->mysqli->error);
}
if ($stmt->execute() == FALSE) {
throw new \Exception($this->mysqli->error);
}
if ($stmt->bind_result($listElemId, $listElemName, $listElemDesc, $listElemOrderPlace) == FALSE) {
throw new \Exception($this->mysqli->error);
}
$listElements = array();
while ($stmt->fetch()) {
$listElements[] = array('listElemId' => $listElemId,
'listElemName' => $listElemName,
'listElemDesc' => $listElemDesc,
'listElemOrderPlace' => $listElemOrderPlace);
}
var_dump($listElements);
$stmt->Close();
return $listElements;
}
from the database:
listElemOrder:
listElemOrderId | listId | listElemId | userId | listElemOrderPlace
1 1 1 46 1
2 1 2 46 4
3 1 3 46 2
4 1 4 46 3
listElement:
listElemId | listElemName | listId | listElemDesc | listElemOrderPlace
1 Elem A 1 Derp NULL
2 Elem B 1 Herp NULL
3 Elem C 1 Lorum NULL
4 Elem D 1 Ipsum NULL
Note: 'listElemOrderPlace' in the table listElement is the final order of the elements (all users average), not to be mixed with the one with the same name in the other table, that's only a specific user's order of the list elements (which is the interesting one in this case).
When I add event handler to a some elements using query:
$('div').mouseover(function () {
});
how can I check inside this function next:
Have this "DIV"child elements
"DIV"?
Have this "DIV" child
element "DIV" whith height more than
300?
hey all,
my site started dragging lately, the queries taking exceptionally longer than I would expect with properly tuned indexes. I just restarted the mysql server after 31 days uptime and every query is now substantially faster and the whole site renders 3-4 times faster.
Would there be anything that jumps out at you as to why this may have been? Improper settings on my.cnf perhaps? Any ideas as to what I can start looking at to try and pinpoint why?
thanks
Hi all, my question is simple but i cant fin de answer. Is there a way to set in Lucene to retrieve an amount of results higher than 100 in a query?
Im using lucene 2.4.0 now.
Thanks all.
how to get the comma separated values stored in the Sql Db into a individual values
e.g in sql DB the column is stored with comma values as shown below,
EligiblGroup
A11,A12,A13
B11,B12,B13
I need to get
EligibleGroup
A11
A12
A13
B11
B12
...
I have written a query that will fetch me some list of employees with employee name and elibigle group
XXX A11
YYY B11
ZZZ C11
I need to check that the employees(XXX,YYY,ZZZ) eligiblegroup falls within this
EligiblGroup
A11,A12,A13
B11,B12,B13
and retrun me only that rows.
For certain types of sql queries, an auxiliary table of numbers can be very useful. It may be created as a table with as many rows as you need for a particular task or as a user defined function that returns the number of rows required in each query.
What is the optimal way to create such a function?
Here is a table structure (e.g. test):
__________________________________________
| Field Name | Data Type |
|________________|_________________________|
| id | BIGINT (20) |
|________________|_________________________|
| title | varchar(25) |
|________________|_________________________|
| description | text |
|________________|_________________________|
A query like:
SELECT * FROM TEST ORDER BY description;
But I would like to order by the field size/length of the field description. The field type will be TEXT or BLOB.
I have to create an SQL Query to get all rows starting with a specific character, except if the parameter passed to the (PHP) function is 0, in that case it should get every row that does not start with A - Z (like #0-9.,$ etc).
What is the easiest and fastest way to get those rows?
DB: MySQL 5.1
Column: title
I am trying to query all post that are made to the wall of a facebook event. But am not making any headway. Is this at all possible. How would you proceed? Create a multiquery FQL statement?
i need to implement the following query in SQL Server
select *
from table1
WHERE (CM_PLAN_ID,Individual_ID)
IN
(
Select CM_PLAN_ID, Individual_ID
From CRM_VCM_CURRENT_LEAD_STATUS
Where Lead_Key = :_Lead_Key
)
but the WHERE..IN clause allows only 1 column. How to compare 2 or more columns with another inner select?
Hello Friends,
I executed this query on my MySql Server and it is giving me "MySQL server has gone away" Error.In following query my both table have more then 1000000 rows.
SELECT a_tab_11_10.url as url,a_tab_11_10.c5 as 't1',a_tab_12_10.c3 as 't2'
FROM a_tab_11_10 join a_tab_12_10 on (a_tab_11_10.url)=(a_tab_12_10.url)
order by (a_tab_11_10.c5-a_tab_12_10.c3) desc limit 10
here is my log file but i am not getting it.
Thank you @Faisal for answer and i check my log file but i am not getting it..
110111 10:19:50 [Note] Plugin 'FEDERATED' is disabled.
110111 10:19:51 InnoDB: Started; log sequence number 0 945537221
110111 10:19:51 [Note] Event Scheduler: Loaded 0 events
110111 10:19:51 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)
110111 12:35:42 [Note] wampmysqld: Normal shutdown
110111 12:35:43 [Note] Event Scheduler: Purging the queue. 0 events
110111 12:35:43 InnoDB: Starting shutdown...
110111 12:35:45 InnoDB: Shutdown completed; log sequence number 0 945538624
110111 12:35:45 [Warning] Forcing shutdown of 1 plugins
110111 12:35:45 [Note] wampmysqld: Shutdown complete
110111 12:36:39 [Note] Plugin 'FEDERATED' is disabled.
110111 12:36:40 InnoDB: Started; log sequence number 0 945538624
110111 12:36:40 [Note] Event Scheduler: Loaded 0 events
110111 12:36:40 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)
110111 12:36:40 [Note] wampmysqld: Normal shutdown
110111 12:36:40 [Note] Event Scheduler: Purging the queue. 0 events
110111 12:36:40 InnoDB: Starting shutdown...
110111 12:36:42 InnoDB: Shutdown completed; log sequence number 0 945538634
110111 12:36:42 [Warning] Forcing shutdown of 1 plugins
110111 12:36:42 [Note] wampmysqld: Shutdown complete
110111 12:36:52 [Note] Plugin 'FEDERATED' is disabled.
110111 12:36:52 InnoDB: Started; log sequence number 0 945538634
110111 12:36:52 [Note] Event Scheduler: Loaded 0 events
110111 12:36:52 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log' socket: '' port: 3306 MySQL Community Server (GPL)
110111 12:37:42 [Note] wampmysqld: Normal shutdown
110111 12:37:42 [Note] Event Scheduler: Purging the queue. 0 events
110111 12:37:42 InnoDB: Starting shutdown...
110111 12:37:43 InnoDB: Shutdown completed; log sequence number 0 945538634
110111 12:37:43 [Warning] Forcing shutdown of 1 plugins
110111 12:37:43 [Note] wampmysqld: Shutdown complete
110111 12:37:46 [Note] Plugin 'FEDERATED' is disabled.
110111 12:37:46 InnoDB: Started; log sequence number 0 945538634
110111 12:37:46 [Note] Event Scheduler: Loaded 0 events
110111 12:37:46 [Note] wampmysqld: ready for connections. Version: '5.1.36-community-log'
socket: '' port: 3306 MySQL Community Server (GPL)
Say you've got the following query on 9i:
SELECT /*+ USE_HASH(t2 t3) */
* FROM
table1 t1 -- this has lots of rows
LEFT JOIN table2 t2 ON t1.col1 = t2.col1
AND t1.col2 = t2.col2
LEFT JOIN table3 t3 ON t1.col1 = t3.col1
AND t1.col2 = t3.col2
Due to 9i not having RIGHT OUTER HASH JOIN, it needs to hash table1 for both joins. Does it re-hash table1 between joining t2 and t3 (even though it's using the same join columns), or does it keep the same hash information for both joins?
Hi all,
Any idea on how to order the results of a MYSQL query by the sum of two columns rather than by a single column?
Select * FROM table ORDER BY (col1+col2) desc
I know that won't work., but I hope it conveys what I want to do fairly well.
Thanks!
I've got a table (col1, col2, ...) with an index on (col1, col2, ...). The table has got millions of rows in it, and I want to run a query:
SELECT col1, COUNT(col2) WHERE col1 NOT IN (<couple of exclusions>) GROUP BY col1
Unfortunately, this is resulting in a full table scan of the table, which takes upwards of a minute. Is there any way of getting oracle to use the index on the columns to return the results much faster?
Hi,
as topic says, I don't want to return the first two letters in the return values
just an example:
select companyname from companies
returns companyX
Can I write a query that returns panyX instead?
Thanks in advance
If I would like to have several static methods in my models so I can say User::get_registered_users() and have it do something like
public static function get_registered_users()
{
$sql = "SELECT * FROM `users` WHERE `is_registered` = 0";
$this->db->query($sql);
// etc...
}
Is it possible to access the $this->db object or create a new one for a static method?
The whole question is pretty much in the title. For each row of the table I'd like to select the maximum of a subset of columns.
For example, from this table
name m1 m2 m3 m4
A 1 2 3 4
B 6 3 4 5
C 1 5 2 1
the result would be
name max
A 4
B 6
C 5
The query must be compatible oracle 8i.
Thanks.
Hi,
I have a project in C# with a Sql-server Database.
In that database I have a table named 'Process' and columns named 'process_name', 'Full_Name' and 'Version' (all of the type:nvarchar(50)).
I want to write a query wich will add the new process, only if it doesn't exist in the table yet.
How can I do that?
Many thanks,
Hi, Is there a way to externalize report queries for BIRT reports. We need to support multiple database engines and so our queries are different depending on the underlying database. I would like to use a config parameter to tell BIRT report to use a specific query file