-
Oracle: Find value for each UserID that has latest date
In my Oracle table, I have three different columns: UserID, Value and Date. I'm trying to get the value for each UserID (that has the latest date). How can I do that? Can I use SQL?
Last updated: -
SQL problem: Order results in descending order
I'm trying to create an SQL statement that produces a listing that shows how many students are coming from each city. How can I order the results set based on the number of students from city in descending order?
-
SQLState=01534 [SQL0181] when running DML instruction in System i Navigator
Hello, I'd like to avoid the message SQLState=01534 [SQL0181]. This appears whenever I run a DML instruction in System i navigator or RDI or ... Thanks for helping! Mathy Paesen
-
SQL error message when creating procedure containing three cursors
I have created a procedure containing 3 cursor. It gives me the below error and when I add @delimiter ++; at start and end it gives message that "command processed" but doesn't show output. Any suggestions? [Error Code: -104, SQL State: 42601] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601,...
-
SQL Express 2008: Gain administration rights
Recently, I got a Windows 7 PC from a friend that has an existing instance of SQL Express 2008. I already have local administration rights but I don't know the SA password. So I can't create databases or modify the password. How can I get SYSAdmin privileges? I tried using SSMS but it didn't work....
Last updated: -
Finding data from a table that is linked with another table using foreign keys
I want to see all the customer names and their city who have an account in a specified bank. Problem is my customers are listed in one table and accounts are listed in another. But I do have another table called depositor where it only store account name and customer name. How can I see customers...
Last updated: -
Find the list of SQL statements run by a particular user on iSeries server
How can I find the list of SQL statements run by a particular user on iSeries server?
Last updated: -
Create SQL script for insert statements / table having blob data
How can I create a SQL script for insert statement / table having blob data?
Last updated: -
How to spool dynamic filenames from SQL script
I need to get different file names each time I run the script. How can I do that?
Last updated: -
I'm trying to import a pretty large SQL file (roughly 6 GB) to my local database. Here's what I'm using: $ mysql -h localhost -u root 'my_data' < foobar.sql $ mysql --version /usr/local/mysql/bin/mysql Ver 14.12 Distrib 5.0.96, for apple-darwin9.8.0 (i386) using readline 5.1 So, I'm wondering if...
Last updated: -
I'm using a PostgreSQL database and I have to benchmark several SQL queries against it. Would there be a way I can actually 'time' my queries using PSQL? Thanks!
Last updated: -
Create DropDowns and populate ASP.NET
I am trying to build a asp.net application with C#. It has a gridview in it that contains dropdownlist. I am looking to have a SQL query run that returns a record set. Lets say it returns 10 items. It should create 10 new rows (which it does). Then it should populate each one of those drop downs...
-
Executing SQL against all databases on a single server
I have a SQL that runs against several databases on our server that helps diagnose issues. Here's what it is: select so.name, so.type, MAX(case when sc.text like '%remote%' then '' ELSE 'N' END) AS Relevant, @@ServerName as Server, DB_Name() as DBName from sysobjects so with (nolock) join...
-
Listing all schemas in PostgreSQL
I'm using PostgreSQL and I need to figure out how to list all schemas using SQL. Can anyone help me? I tried using the below code but it didn't work. SELECT something FROM pg_blah; Thanks!
Last updated: -
Copy SQL stored procedure from local to live database
Hello, I want to copy multiple procedures from a local database to a live database?
Last updated: -
My SQL select statement returns data, but an almost identical fetch does not, although the SQL code is 0, sqlstt is '0000', and sqlwarn is all blanks. What am I doing wrong? dcl-ds prtsplds; outnam char(10); libnam char(10); nofils char( 5); writer char(10); status char( 3); end-ds; exec sql...
Last updated: -
How do insert many images (BLOB) into a SQL Server table
How do I insert several images (BLOB) in to a SQL Server table?
Last updated: -
Generate multiple reports in SQL
Dear Tech, this is Mushkin from Hyderabad, India. I have MS SQL data. I want to generate Multiple Reports in one Report. I tried myself but with no success. Please help me with this. I send you data. I used technologies including: Visual Basic 6.0, MS SQL 2008 and Crystal Reports 8.5.
Last updated: -
I want to run a SQL query automatically and getting the output in Outlook from remote desktop daily. How do I automate it?
Last updated: -
Informix SQL Update using an inner join
I have a need to update 270,000 records with a particular flag. Using temporary tables and multiple update queries I have creating a staging table to put the original value and the new value. So the table structure is like this: ID ORIG_VALUE NEW_VALUE 1223 A B 1234 D A 1334 ... I'm struggling with...
Last updated: