Questions tagged [select-query]

176 questions
-1
votes
2 answers

mysql adding total price of certain products

hi i'm having problems querying a products table at the moment: i need to display the total cost of all HP and toshiba products.. this is what i have tried so far SELECT * FROM products WHERE prod_id LIKE '__hp%' AND SELECT SUM(price) AS total …
Jmac88
  • 91
  • 1
  • 3
  • 14
-1
votes
1 answer

how to speed up the select statement among multiple tables

Do you have any idea how I can improve the following sql select query? It takes a while to get results even in sql management studio. So, it takes longer when I call it from the website. I get the top 15 results but it still takes time to get…
renakre
  • 8,001
  • 5
  • 46
  • 99
-1
votes
3 answers

mysql - Set more than one value for 'WHERE' condition

I have the following query: $select_query = "SELECT * FROM users WHERE userName='$user_name', password='$password'"; The problem is that the query always fail, so how can I fix the 'WHERE' condition?
Nave Tseva
  • 868
  • 8
  • 24
  • 47
-1
votes
1 answer

How to improve query performance in sql?

I have a table with 2900000 records. Now I am using select query to find data and it will take 5 secs to fetch records. It's just select query and it will take 4-5 seconds to run it. I dont know why it will take so much of time? In the table, there…
Brijesh Patel
  • 2,901
  • 15
  • 50
  • 73
-2
votes
1 answer

Alphanumeric sort on nvarchar(50) column

I am trying to write a query that will return data sorted by an alphanumeric column, Code. Below is my query: SELECT * FROM <> CROSS APPLY (SELECT PATINDEX('[A-Z, a-z][0-9]%', [Code]), CHARINDEX('', [Code]) )…
R2B Boondocks
  • 394
  • 1
  • 2
  • 16
-2
votes
2 answers

How to construct a Joomla! query for matching two field values in a table?

i have a table #__newtoys_variants having many fields of which id and v_prod_id are there. Now although id is unique - the v_prod_id is product id The url displays product information and…
Ruchika
  • 503
  • 1
  • 8
  • 26
-2
votes
3 answers

About a Select Query

I want to get to know the SQL query to find names of a column (egCustomerName) whose names having (anyletter) ‘l’ as the third letter
-2
votes
1 answer

SQLite query not work on Android rawQuery

Edit: Problem solved, query is correct. My problem is; I work with local database. And i'm not reach database directly from assets folder. My code copy database from assets folder to SD card when database not exits on SD card. Therefore my database…
Mete
  • 2,805
  • 1
  • 28
  • 38
-2
votes
2 answers

display records of a specific year in php mysql

I have a system that shows records year wise. I have dropdown menu from which user selects year, and I am storing that value in variable $year. So now when $year = 2013-2014, it should not display records of year 2014-2015. BTW when I insert my…
ashah142
  • 560
  • 1
  • 5
  • 12
-2
votes
1 answer

Date not equals to two dates

I have got data from table. There is one datetime field in table. Field name is createdon In select query I pass two datetime parameters Now I want all data from table where createdon field is not equals to these two date time parameters.
user1817367
  • 43
  • 1
  • 1
  • 5
-3
votes
1 answer

Removing title from select query in PHP

Is there any way to select a table in SQLite without printing the column headers? The following is the code I am using: SELECT realPow, timestamp FROM PowerData; //To loop through the table and fetch the data for Real power while($res =…
user3523549
  • 33
  • 1
  • 1
  • 4
1 2 3
11
12