Tag: c

55 votes
21 answers
1.8K views
Function vs. Stored Procedure in SQL Server

I've been learning Functions and Stored Procedure for quite a while but I don't know why and when I

avatar
Keila
0 1 0 9
asked 07 September, 2021
63 votes
24 answers
2.6K views
Search text in stored procedure in SQL Server

I want to search a text from all my database stored procedures. I use the below SQL: SELECT DISTINCT o.

avatar
Scot
0 1 0 9
asked 07 September, 2021
61 votes
17 answers
1.2K views
Save PL/pgSQL output from PostgreSQL to a CSV file

What is the easiest way to save PL/pgSQL output from a PostgreSQL database to a CSV file? I'm using Pos

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
63 votes
15 answers
1.4K views
When should I use CROSS APPLY over INNER JOIN?

What is the main purpose of using CROSS APPLY? I have read (vaguely, through posts on the Internet) that cros

avatar
Sena
0 1 0 9
asked 07 September, 2021
61 votes
25 answers
3K views
SQL update from one Table to another based on a ID match

I have a database with account numbers and card numbers. I match these to a file to update any card numbers to

avatar
Boyd
0 1 0 9
asked 07 September, 2021
65 votes
14 answers
3.1K views
How do I limit the number of rows returned by an Oracle query after ordering?

Is there a way to make an Oracle query behave like it contains a MySQL limit clause? In MySQL, I can do this:

avatar
Vi
0 1 0 9
asked 07 September, 2021
50 votes
24 answers
1.7K views
Get list of all tables in Oracle?

How do I query an Oracle database to display the names of all tables in it?

avatar
Freida
0 1 0 9
asked 07 September, 2021
65 votes
3 answers
2K views
Using group by on multiple columns

I understand the point of GROUP BY x. But how does GROUP BY x, y work, and what does it mean?

avatar
Dusty
0 1 0 9
asked 07 September, 2021
52 votes
13 answers
2.5K views
Can I concatenate multiple MySQL rows into one field?

Using MySQL, I can do something like: SELECT hobbies FROM peoples_hobbies WHERE person_id = 5; My Output:

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
55 votes
24 answers
1.9K views
How to reset AUTO_INCREMENT in MySQL

How can I reset the AUTO_INCREMENT of a field? I want it to start counting from 1 again.

avatar
Scot
0 1 0 9
asked 07 September, 2021
63 votes
7 answers
2.1K views
What are the options for storing hierarchical data in a relational database?

Good Overviews Generally speaking, you're making a decision between fast read times (for example, nested

avatar
Leonardo
0 1 0 9
asked 07 September, 2021
52 votes
28 answers
2.1K views
Insert into ... values ( SELECT ... FROM ... )

I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for

avatar
Basil
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
1.9K views
How do I perform an IF...THEN in an SQL SELECT?

How do I perform an IF...THEN in an SQL SELECT statement? For example: SELECT IF(Obsolete = 'N' OR

avatar
Joseph
0 1 0 9
asked 07 September, 2021
62 votes
30 answers
1.3K views
Insert results of a stored procedure into a temporary table

How do I do a SELECT * INTO [temp table] FROM [stored procedure]? Not FROM [Table] and without defining [temp

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
67 votes
30 answers
891 views
How to concatenate text from multiple rows into a single text string in SQL Server

Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this i

avatar
Xavier
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
751 views
Finding duplicate values in a SQL table

It's easy to find duplicates with one field: SELECT name, COUNT(email) FROM users GROUP BY email HAVING

avatar
Elicia
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
1.3K views
How do I import an SQL file using the command line in MySQL?

I have a .sql file with an export from phpMyAdmin. I want to import it into a different server using the comma

avatar
Sydney
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
1.7K views
How do I UPDATE from a SELECT in SQL Server?

In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement: INSERT INTO Table

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
61 votes
17 answers
2.4K views
Jquery - How to make $.post() use contentType=application/json?

I've noticed that when using $.post() in jquery that the default contentType is application/x-www-form-ur

avatar
Chaya
0 1 0 9
asked 07 September, 2021
54 votes
9 answers
795 views
How can I add a custom HTTP header to ajax request with js or jQuery?

Does anyone know how to add or create a custom HTTP header using JavaScript or jQuery?

avatar
Rudy
0 1 0 9
asked 07 September, 2021