The Sybase database is a great option provided by SAP Company, currently this DBMS has gained much space in the market for Web development and can you have more information about this on our official page about Sybase in PHP projects. Because of this situation it is important to understand how the database works and then we’ll learn how to perform a query on tables that are contained in it.

Using SQL language, the command used to query records in the table is SELECT. Check it out below.

SELECT [Columns] FROM [Table]

The syntax used is very similiar to other DBMS, so it is very simple to understand it if you’ve mastered some database that uses it. Below we go to a practical example where a query is performed on the Products table.

SELECT Name, Price, Color FROM product

In the example above the query will return all records from the table, but for that you have more quality of the analyzes you can still use other command like:

  • ORDER BY: Used for ordering data table from column;
  • GROUP BY: Used for grouping data table from column;
  • WHERE:Clause used to filter a query from a conditional.

SELECT Name, Price, Color FROM product ORDER BY Name

SELECT Name, Price, Color FROM product GROUP BY Color

SELECT Name, Price, Color FROM product WHERE Price > 500

In the first example the query will return the data sorted by the Name column, in the second we have a query grouped by the colors of each product and the last query only products that cost more than 500 dollars.

I hope you enjoyed these tips. Follow our blog and stay on top of all the news.

By ,

October 14, 2013

a

You might also like…

“We have developed the Connected Citizen Card, which assists public administrators in decision-making and policy creation.”(Assist Soluções em TI)

Check below how Assist Soluções em TI used Scriptcase to modernize and streamline the development...

AI-Driven Software Development: The Role of ChatGPT

In the rapidly evolving world of technology, artificial intelligence (AI) is playing an increasingl...

Low-Code: The Key to Accessible Digital Transformation

Digital transformation is imperative for companies wishing to remain competitive in the current era...

You might also like…

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at sales@scriptcase.net. Learn more about our Privacy Police.