Okay, so I wanted to mess around with Oracle and try to pull out some specific data. I’d heard about this “pick 3” thing, figured I’d give it a shot. I’m not a database guru or anything, just like tinkering.
Getting Started
First things first, I fired up my Oracle SQL Developer. I already had a database connection set up, but if you don’t, you’ll need to do that. You know, the usual stuff: hostname, port, SID, username, password.
Crafting the Query
Now, the “pick 3” idea, as I understand it, is basically just selecting three specific things. I wasn’t working with lottery numbers or anything, just a regular table I had with some customer data. I decided I wanted to pick the customer’s ID, their name, and maybe their city.
So, I started typing out a basic SELECT statement:
SELECT customer_id, customer_name, city
FROM my_customer_table;
Pretty straightforward, right? I just replaced `my_customer_table` with the actual name of my table.
Running the Query
I hit that little run button (the green triangle thingy) in SQL Developer, and boom! There it was. A nice little table showing me just those three columns: customer ID, name, and city. I was happy.
Adding Some Conditions
I wanted a filter, so I added some “WHERE” conditions. I add “WHERE” statement at last of SELECT statement
SELECT customer_id, customer_name, city
FROM my_customer_table
WHERE city = 'London';
Seeing the Results
I changed customer’s city to find and I did it.
I hit that little run button in SQL Developer again, and boom! There it was again!
I realize there many ways to do it, and many function name to use, but I did what I wanted.