I have 2 Files. One is aspx and its ascx. aspx contains Javascript which calculates count down time for exam. while timer value reaches to 00:00:00 I want to invoke an event “Submit Exam” which is in ascx file. Final Paper.aspx.cs Final Paper.aspx Exam_paper.ascx Answer Make your btnSubmit a publi…
Tag: sql
PhpMyAdmin does not show Query results operations at the bottom of Query Result
I can see Query results operations which gives me a way to export my query result for some queries but not for others where there is a query with bunch of joins. I feel its the type of Query. Is that the reason or is it the number of results? Snapshot of the actual query : Replaced the variables for
fetching a row in the middle of the table
Table reservation contains 500,000 records and bx_date varies from 2012-01-01 to 2013-01-01. 40,000 records in users table. bx_date is ‘date’ type. With the query above if I tried a date like 2012-08-22, It takes 8 secs. But if I tried 2013-01-01 It takes like 1 sec. What is the reason? Answer The…
Export database schema into SQL file
Is it possible in MS SQL Server 2008 to export database structure into a T-SQL file? I want to export not only tables schema but also primary keys, foreign keys, constraints, indexes, stored procedures, user defined types/functions. Also I don’t want the data to be present in this T-SQL file. Is there a…
IIF(…) not a recognized built-in function
I’m trying to use this in Microsoft SQL Server 2008 R2: But I get an error: IIF(…) is not a recognized built-in function name Is IIF() only compatible with a later version? Is there an alternate function I can use? Answer IIF comes from SQL 2012. Before then, you can use CASE:
Normalize array subscripts so they start with 1
PostgreSQL can work with array subscripts starting anywhere. Consider this example that creates an array with 3 elements with subscripts from 5 to 7: Returns: We get the first element at subscript 5: I want to normalize 1-dimensional arrays to start with array subscript 1. The best I could come up with: The s…
getting count from the same column in a mysql table?
I wanted to a count of the same field for different values for example: user{user_id, gender} Gender can have obviously male or female 🙂 i want to get count for all the males and females i.e. but im confused because they come from the same gender coloumn thanks Answer Try this for row wise result: Output: Try…
Search a whole table in mySQL for a string
I’m trying to search a whole table in mySQL for a string. I want to search all fields and all entrees of a table, returning each full entry that contains the specified text. I can’t figure out how to search multiple fields easily; here are the details: The table is “clients”. It has ab…
TeraData aggregate function
When I try to select couple of columns with count, I get the following error: Selected non-aggregate values must be part of the associated group My query is something like this. Answer If you’re after a count for each combination of COLUMN1 and COLUMN2: If you’re after a count of all records in th…
Oracle SQL Loader – How to not display “Commit point reached – logical record count” counts
I’m loading big files via Oracle SQL Loader over vpn from home, and they’re taking a lot of time. They were a lot faster to load when I loaded them from work. The files I’m loading are on my work server already. So my thinking is that the slow down is because of the “Commit point reach…