query

help removing mysql file sort

Here is the log output: # Time: 100915 13:06:49 # User@Host: ss[ss] @ localhost [] # Query_time: 13.978355 Lock_time: 0.000029 Rows_sent: 10 Rows_examined: 562760 use ss; SET timestamp=1284574009; SELECT DISTINCT SQL_CALC_FOUND_ROWS B.*, U.username FROM sc_users AS U, sc_bookmarks AS B ...

Query Hardware-Specific Information on Windows With C++

Specifically, I want to query a system's GPU for the following: The name of the GPU, the series (e.g. ATI Radion 5800, NVIDIA GeForce 4 MX, etc.), the BIOS version, the driver version, the GPU clock speed, the GPU memory speed, the memory type, the memory size, the bus width, the bandwidth, the type of bus being used, the vendor. Any i...

Complicated Crosstab Query Question

I have the following 2 tables: 1) Companies ID CompanyName Abbreviation Notes 1 CompanyA CA ... 2 CompanyB CB ... 3 CompanyC CC ... 2) PlannedDeployments ID CompanyID TypeID DepDate NumDeployed 1 1 ...

how to search between 2 dates and times in access ?

hi i have in my access fields MyDate and myTime. MyDate in format: 16/09/2010 00:00:00 MyTime in format: 16/09/2010 04:27:00 i need to search between date 01/01/2010 and time 12:50:00 - and - date 12/11/2010 time 01:34:00 which query i need to write ? thank's in advance ...

mysql query help : show field Appearance count and Appearance Percentage

What I need is query that show : How many times value in field is Appearance and how many Percentage is from the total. What I have until now is : SELECT field, COUNT(field) FROM table GROUP BY field; That show me result of how many time every value is Appearance. How can I get also the Appearance Percentage in one query ? I try...

mysql - getting the last 10 unique months

I want to get the last 10 unique months where there have been events, stored as event_date as a mysql date. I am using coldfusion so could group the result but can't get that working as I would like. This is what I have so far. SELECT MONTH(event_date) AS month, YEAR(event_date) AS year, event_date from events so ideally if there wer...

select unique items with linq

When I use the following code I get the same items multiple times. XElement neededFiles = new XElement("needed", from o in _9nFiles.Elements() join t in addedToSitePull.Elements() on o.Value equals t.Value where o.Value == t.Value select new XElement("pic", o.Value)); I'd like to get only unique items...

Is there a LIKE Clause for querying XML in SQL

I'm using SQL Server 2005 and am wondering if there is any way to do a LIKE clause in my xml searches. Here's a sample query: SELECT Id, CaseNumber, XmlTest FROM UploadReport WHERE CASE WHEN @lastName != '' AND XmlTest.exist('(/CodeFiveReport/Parties/Party/Name/LastN...

CommandText is not initialized

I have this code Dim LogData As sterm.markdata = New sterm.markdata() Dim datelistquery As String Dim properdate As String If Session("TenHolStDateHP1") = "%" or Session("TenHolStDateHP1") = "" Then If Session("passedPropId") = "" Then 'QUERY USED IF NO DATE SELECTED AND A PROPID HAS NOT BEEN PASSED datelistquery = "S...

help with access query

hi i have table MyTbl that contain date1, date2, date3 if date1=null i need that in field memo will be 'A' elae if date2=null i need that in field memo will be 'B' else if date3=null i need that in field memo will be 'C' is it can made on access 2007 in query ? thank's in advance ...

How to write WHERE IN query in LINQ to Entity?

Possible Duplicate: 'Contains()' workaround using Linq to Entities? Hi every one. I would like to know how to write the "WHERE IN" query in LINQ to Entity. I have tried with the following code: string[] strings = GetRequest("userID").Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); List<long> longs = strings....

Query for newest record in a table, store query as view

I'm trying to turn this query into a view: SELECT t.* FROM user t JOIN (SELECT t.UserId, MAX( t.creationDate ) 'max_date' FROM user t GROUP BY t.UserId) x ON x.UserId = t.UserId AND x.max_date = t.creationDate But views do not accept subqueries. What this does is look for the la...

How do I do mysql join statement on multiple table hierarchy levels?

Suppose I have the following table house: House: id name cityID Where cityID refers to the id field of table city City: id name stateID where stateID refers to the id field of table state State: id name countryID where countryID refers to the id field of the table country: Country: id name How do I do mysql join statements s...

MySQL IN with LIKE

How would I use a IN table with like? So that I could use % in them? By in I mean: SELECT fields FROM table WHERE age = "50" AND name IN ("tim", "bob", "nancy", "john"); I already tried: SELECT fields FROM table WHERE age = "50" AND name LIKE ("2010-09-17%", "2010-09-16%") But it gave the error "Operand should...

about date in database question

hi i need to find data between 2 date's and time's. i use one field for date , and one field for time. is it be better to use only one field for date & time ? i see that it came in dd/mm/yyyy hh:mm:ss format that can contain date and time. this question is for acceess and for sql-server thank's in advance ...

Facing error of "The default schema does not exist." when executing runtime query inside sp using exec()

Hi, i have made a runtime query inside a sp and am exceuting the query within the sp using exec(), but when creating the sp i am getting the error The default schema does not exist. The SP is: CREATE PROCEDURE MySP @tableName varchar(100) AS BEGIN SET NOCOUNT ON; declare @selectQuery varchar(MAX) set @selectQuery = 'se...

Query cache in SQLite

Is there any mechanism to keep query results in order to reuse them the next time this query occurs? I'm not talking about SQLite's cache that stores pages retrieved from a database file. This is more about a query execution without using SQLite B-tree and Pager modules. ...

Copy data from table of one db into table of another db using query (both tables have same structure)

I have two database in the same schema. My db is in Postgres. I want to copy data of any table (i.e product) of my 1st db into the same table of the 2nd db. Is it possible to do so using query? ...

Why cant I execute this alter procedure firebird query?

the query is: SET TERM ^ ; ALTER PROCEDURE SALVARROTA ( datahora timestamp, distancia double precision, custo double precision, capacidadelivre double precision, capacidadetotal double precision, nome varchar(50), depositox double precision, depositoy double precision, chegadax double precision, ...

TSQL Is returning boolean is not possible ?

Can't i write something in TSQL declare @set1 int declare @set2 int set @set1=1 set @set2=2 select @set1 < @set2 by getting true as result? I Know i can use case when @set<@set then 'true' but can't i do by the way i have written above? ...