query

Select all row for specific column query SQL Server 2008

i want to know what is the wrong in this query I want to select all rows for 1 column string command = "select money from User_Data"; SqlCommand update_money = new SqlCommand(command, con_string.con); SqlDataReader money_reader; money_reader = update_money.ExecuteReader(); ...

How to develop a Query Analyzer

I want to develop the application in which user write query into the text box when it click on the submit button it displays the results in the Grid just just in the Sql Server query analyzer tool i used VS 2008 and application develop in Asp.Net using C#. Thanks ...

YouTube UITableView from a search query using GData

Hello, I'm trying to customize a table view to display a feed of youtube videos based on a search query. I found this code http://pastebin.com/vmV2c0HT which displays a feed of a YouTube channel in a tableview, it works fine. However, when modifying the viewDidLoad function to search for a query instead of a user feed, I always end up w...

sql "LIKE" Query syntax

what is the wrong in this Query ? string command_get_pay = "select Credit from Update_Company_Credit where (Update_Date LIKE '%" + System.DateTime.Today.ToShortDateString() + "%')"; ...

intersection "where LIKE" QUERY IN sql

what is the syntax of sql query has intersection between 2 "where Like" condition string command_get_pay = "select Credit from Update_Company_Credit where ( Update_Date LIKE '%" + 8 + "%'& Update_Date LIKE 18'%" + 8 + "%')";` is this true I try it but I got exception in syntax ...

Infopath XML query from C#

Hi, I have included an XML file in my InfoPath form as a secondary data source. The data connection is named Divisions. Below is the structure and content of the file: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Divisions> <Division> <Name>Business Application Services</Name> <Abbr>BAS</Abbr> </Divi...

How do I improve the performance of this simple LINQ?

I have two tables, one parent "Point" and one child "PointValue", connected by a single foreign key "PointID", making a one-to-many relation in SQL Server 2005. I have a LINQ query: var points = from p in ContextDB.Points //join v in ContextDB.PointValues on p.PointID equals v.PointID w...

How to select from database with relations?

Hi, I have database with schema on picture below and I need to select everything related to one row (one id) of [letaky]. That means the related [zamestnanci], every related [obsah] and every [knihy] in it. This is the first time i used relations in database and i have no idea how to make such a select. ...

How does MySQL behave in JOIN cases where ORDER BY and LIMIT are specified and only a small number of rows need actually be JOINed?

Suppose I have the following tables: CREATE TABLE Game ( GameID INT UNSIGNED NOT NULL, GameType TINYINT UNSIGNED NOT NULL, PRIMARY KEY (GameID), INDEX Index_GameType (GameType, GameID) ) ENGINE=INNODB CREATE TABLE HighScore ( Game INT UNSIGNED NOT NULL, Score SMALLINT UNSIGNED, PRIMARY KEY (Game), INDEX ...

SQL Search Query using keywords

I currently have a SQL query that returns results based on a dynamic number of keywords passed in. I convert the list of keywords into a table and join to it. SELECT * FROM Table1 INNER JOIN dbo.udf_List2Table(@Keywords, ',') ON (Field1 LIKE '%'+Keyword+'%') This is working fine but it returns all rows that contain an...

Special SQL Query build

Hello. I need to retrieve from database list of manufacturers (table producenci), but only from particular products category. Actual query looks like this, but it returns 0 records. If I remove WHERE, it returns whole table producenci. SELECT DISTINCT ( pr.id ), pr.nazwa FROM producenci pr LEFT JOIN produkty ON pr.id = produkty.produce...

Update 20 rows in mysql with x=x+1 values?

Hi there In mysql I have a table with like 20 rows (example). I want to write sort order (it is in array that carried picID's) to the SORT column from 1 to x (x is the number of items in this example x=20). My array starts with: [10,15,1...] I can do: UPDATE table SET sort=1 WHERE picID=10 UPDATE table SET sort=2 WHERE picID=15 UPDAT...

Performance of a SETOF returning function which returns results of another SETOF function?

I have written a function that takes two arguments and returns a SETOF result. CREATE FUNCTION foo(parentId bigint, childId bigint) RETURNS SETOF bar AS ... I would like to write two "wrappers" for this function that make it simpler to call: CREATE FUNCTION foo_parent(parentId bigint) RETURNS SETOF bar AS ... BEGIN RETURN ...

MySQL Select Query when wanting groups of x elements returned in batches

How to return a select result with batches through a single query, that should be a straight forward compound select somehow. Below is a sample table and a simple query that will generate the desired result by currently using a temporary numeric column that could not work in the final real world process. There are only two key columns ...

Column not found error with simple SQL query

I know its almost there, but base is telling me it can't find a column called table1.id when I know its there! UPDATE table2 SET col1 = (SELECT field1 FROM table1 WHERE table2.id = table1.id) WHERE table1.id = table2.id ...

JQuery Validation Engine, doesn't live validate if i add a element after page was loaded?

Hey, at the moment i'm using this validation plugin: (http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/) but when it comes to the part of validating i have a problem. If i want to be able to validate a element which doesn't exist from the beginning, it only validates it when i press su...

Display only queried ID+row PHP/MySQL

Hi, I have my data stored in a MySQL table, which includes an auto_increment ID number (unique) for each new row. I'd like users to be able to get a certain ID number, using the $_GET function. eg. User loads http://mysite.com/id.php?id=123 Page displays ID number 123 along with the row. echo $row['id']; echo "<table>"; echo "<tr> <t...

Query compatibility SQL server 2008/2000

Hi, I am developing some stored procedures in SQL Server 2008. Some of our customers are running SQL Server 2000. Is there a way to check whether my queries are compatible without having to install SQL Server 2000? Maybe a transact sql tester? Regards, Michel ...

Wordpress SQL query: get random child page

I want my site to have a random "welcome" page. I've found a plugin that redirects to a random page. I want to specify a parent page that random child pages are selected from. This is the query that the plug-in uses: $query = "SELECT ID FROM $wpdb->posts WHERE post_type = 'page' AND post_password = '' AND post_status = 'publish' ORDE...

Mysql "IN" as AND

Hi, I would like to know if a mysql IN can be used as a AND statement: SELECT item_id FROM table_items as a i WHERE i.attribute_id IN ( SELECT attribute_id FROM table_attribute as a WHERE [..] ) I want to select the items from table_b who contains all the values selected in table_a. In other words the previous query is selectin...